I4A API 2.0: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
No edit summary  | 
				|||
| Line 55: | Line 55: | ||
'''Example''':  | |||
<syntaxhighlight lang="bash">  | |||
curl --location --request POST 'https://yourdomain.com/i4a/api2/contacts/' \  | |||
--header 'authKey: XXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX' \  | |||
--header 'Content-Type: application/json' \  | |||
--form 'filter="lastName:Doe"'  | |||
</syntaxhighlight>  | |||
'''Response:'''  | |||
<syntaxhighlight lang="json">  | |||
{  | |||
    "success": true,  | |||
    "data": [  | |||
        {  | |||
            "zip": "45242",  | |||
            "corpexpiration": "2034-11-01 01:00:00.0",  | |||
            "c_user_memo": "",  | |||
            "c_user_dmlnum2": "",  | |||
            "c_user_multiples2": "one,two,three",  | |||
            "firstname": "Timothy",  | |||
            "customid": "645",  | |||
            "c_user_felix_file": "",  | |||
            "email": "felix@i4a.com",  | |||
            "contactid": "693295",  | |||
            "corptype": "Regular",  | |||
            "country": "US",  | |||
            "c_user_test_default_no": false,  | |||
            "lastname": "Andrus",  | |||
            "c_user_dmlbool2": 1,  | |||
            "iscorp": 1,  | |||
            "corpjoindate": "2017-09-12 01:00:00.0",  | |||
            "id": "693295",  | |||
            "c_user_multiples": "one;two;three",  | |||
            "middle": "J.",  | |||
            "c_user_pets": "cats,monkeys",  | |||
            "c_user_photo": "",  | |||
            "orgid": "115893",  | |||
            "c_user_yesorno": false,  | |||
            "suffix": "",  | |||
            "creationdate": "2018-04-16 12:18:30.0",  | |||
            "modifiedby": "693295",  | |||
            "c_user_gender": "",  | |||
            "modifieddate": "2021-12-08 13:22:47.0",  | |||
            "isemail": 0,  | |||
            "c_user_graduationdate": "",  | |||
            "datedropped": "",  | |||
            "isactive": 1,  | |||
            "daterenewed": "2022-12-09 01:00:00.0",  | |||
            "company": "HQC Inc.",  | |||
            "region": "",  | |||
            "c_user_birthday": "",  | |||
            "prefix": "Mr.",  | |||
            "c_user_torftrueisdefault": 1,  | |||
            "review": 0,  | |||
            "c_user_test": "",  | |||
            "c_user_certified": "",  | |||
            "ccmail": "",  | |||
            "c_user_uploadbio": "",  | |||
            "c_user_testing_true_false_now": 0,  | |||
            "phone": "5551234",  | |||
            "state": "OH",  | |||
            "paidthru": "2034-11-01 01:00:00.0",  | |||
            "c_user_end_market": "",  | |||
            "primarycontact": "693295",  | |||
            "url": "",  | |||
            "c_user_responseoptionsmistake": "",  | |||
            "member_status": "",  | |||
            "address1": "10315 Deerfield",  | |||
            "isdirectory": 1,  | |||
            "address3": "",  | |||
            "address2": "",  | |||
            "datejoined": "2007-07-23 05:00:00.0",  | |||
            "c_user_occupation": "",  | |||
            "c_user_responseoptions": "",  | |||
            "addid": "140462",  | |||
            "groupid": 0,  | |||
            "c_user_text_test": "",  | |||
            "city": "Cincinnati",  | |||
            "isprimary": 1,  | |||
            "c_user_dmldate": "",  | |||
            "informalname": "",  | |||
            "c_user_felix_test_numbers": "",  | |||
            "c_user_dmlnum": 1,  | |||
            "title": "",  | |||
            "fax": "",  | |||
            "c_user_resume": "",  | |||
            "c_user_textforregularmbrs": ""  | |||
        },  | |||
        {  | |||
            "zip": "",  | |||
            "corpexpiration": "",  | |||
            "c_user_memo": "",  | |||
            "c_user_dmlnum2": "",  | |||
            "c_user_multiples2": "one,two,three",  | |||
            "firstname": "AffiniPay",  | |||
            "customid": "649",  | |||
            "c_user_felix_file": "",  | |||
            "email": "bob@barker.com",  | |||
            "contactid": "693681",  | |||
            "corptype": "",  | |||
            "country": "US",  | |||
            "c_user_test_default_no": false,  | |||
            "lastname": "eCheck",  | |||
            "c_user_dmlbool2": 1,  | |||
            "iscorp": 0,  | |||
            "corpjoindate": "",  | |||
            "id": "693681",  | |||
            "c_user_multiples": "one;two;three",  | |||
            "middle": "",  | |||
            "c_user_pets": "cats,monkeys",  | |||
            "c_user_photo": "",  | |||
            "orgid": "150514",  | |||
            "c_user_yesorno": false,  | |||
            "suffix": "",  | |||
            "creationdate": "2021-11-08 15:31:50.0",  | |||
            "modifiedby": "692686",  | |||
            "c_user_gender": "",  | |||
            "modifieddate": "2021-11-08 15:31:50.0",  | |||
            "isemail": 0,  | |||
            "c_user_graduationdate": "",  | |||
            "datedropped": "",  | |||
            "isactive": 1,  | |||
            "daterenewed": "",  | |||
            "company": "",  | |||
            "region": "",  | |||
            "c_user_birthday": "",  | |||
            "prefix": "",  | |||
            "c_user_torftrueisdefault": 1,  | |||
            "review": 0,  | |||
            "c_user_test": "",  | |||
            "c_user_certified": "",  | |||
            "ccmail": "",  | |||
            "c_user_uploadbio": "",  | |||
            "c_user_testing_true_false_now": 0,  | |||
            "phone": "jjkjkkk",  | |||
            "state": "OH",  | |||
            "paidthru": "",  | |||
            "c_user_end_market": "",  | |||
            "primarycontact": "693681",  | |||
            "url": "",  | |||
            "c_user_responseoptionsmistake": "",  | |||
            "member_status": "",  | |||
            "address1": "44j3j4j3k4k",  | |||
            "isdirectory": 1,  | |||
            "address3": "",  | |||
            "address2": "",  | |||
            "datejoined": "",  | |||
            "c_user_occupation": "",  | |||
            "c_user_responseoptions": "",  | |||
            "addid": "140467",  | |||
            "groupid": "693681",  | |||
            "c_user_text_test": "",  | |||
            "city": "kjkjkjkk",  | |||
            "isprimary": 1,  | |||
            "c_user_dmldate": "",  | |||
            "informalname": "",  | |||
            "c_user_felix_test_numbers": "",  | |||
            "c_user_dmlnum": 1,  | |||
            "title": "",  | |||
            "fax": "",  | |||
            "c_user_resume": "",  | |||
            "c_user_textforregularmbrs": ""  | |||
        }  | |||
    ],  | |||
    "error": "",  | |||
    "page": 1,  | |||
    "pagesize": "100"  | |||
}  | |||
</syntaxhighlight>  | |||
=== Views Endpoint ===  | === Views Endpoint ===  | ||
Revision as of 14:40, 26 October 2022
Security
For security purposes, I4A API 2 will only work on a secure port through HTTPS. To access any of the API functionality, you must first authenticate. Information is available on the API Settings page on how to obtain the values needed to authenticate and update them, if need be.
Authentication Endpoint
POST /i4a/api2/authenticate/
Parameters 
username
required | string  | 
See API Settings page on how to obtain the value. | 
password
required | string  | 
See API Settings page on how to obtain the value. | 
token
required | string  | 
See API Settings page on how to obtain the value. | 
Example:
curl --location --request POST 'https://<yourdomain.com>/i4a/api2/authenticate' \
--form 'username="XXXXXXXX"' \
--form 'password="XXXXXXXX"' \
--form 'token="XXXXXX-XXXX-XXXXX-XXXXXXXXXXX"'
Response:
{
    "expiration": "{ts '2022-10-25 16:03:47'}",
    "success": true,
    "authKey": "XXXXXX-XXXX-XXXXX-XXXXXXXXXXX",
    "error": ""
}
Retrieving Data
Once you have successfully obtained the authKey, you can then access a few different read-only endpoints. Note: Your authKey will expire after 4 hours.
Contacts Endpoint
POST /i4a/api2/contacts/
Example:
curl --location --request POST 'https://yourdomain.com/i4a/api2/contacts/' \
--header 'authKey: XXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--form 'filter="lastName:Doe"'
Response:
{
    "success": true,
    "data": [
        {
            "zip": "45242",
            "corpexpiration": "2034-11-01 01:00:00.0",
            "c_user_memo": "",
            "c_user_dmlnum2": "",
            "c_user_multiples2": "one,two,three",
            "firstname": "Timothy",
            "customid": "645",
            "c_user_felix_file": "",
            "email": "felix@i4a.com",
            "contactid": "693295",
            "corptype": "Regular",
            "country": "US",
            "c_user_test_default_no": false,
            "lastname": "Andrus",
            "c_user_dmlbool2": 1,
            "iscorp": 1,
            "corpjoindate": "2017-09-12 01:00:00.0",
            "id": "693295",
            "c_user_multiples": "one;two;three",
            "middle": "J.",
            "c_user_pets": "cats,monkeys",
            "c_user_photo": "",
            "orgid": "115893",
            "c_user_yesorno": false,
            "suffix": "",
            "creationdate": "2018-04-16 12:18:30.0",
            "modifiedby": "693295",
            "c_user_gender": "",
            "modifieddate": "2021-12-08 13:22:47.0",
            "isemail": 0,
            "c_user_graduationdate": "",
            "datedropped": "",
            "isactive": 1,
            "daterenewed": "2022-12-09 01:00:00.0",
            "company": "HQC Inc.",
            "region": "",
            "c_user_birthday": "",
            "prefix": "Mr.",
            "c_user_torftrueisdefault": 1,
            "review": 0,
            "c_user_test": "",
            "c_user_certified": "",
            "ccmail": "",
            "c_user_uploadbio": "",
            "c_user_testing_true_false_now": 0,
            "phone": "5551234",
            "state": "OH",
            "paidthru": "2034-11-01 01:00:00.0",
            "c_user_end_market": "",
            "primarycontact": "693295",
            "url": "",
            "c_user_responseoptionsmistake": "",
            "member_status": "",
            "address1": "10315 Deerfield",
            "isdirectory": 1,
            "address3": "",
            "address2": "",
            "datejoined": "2007-07-23 05:00:00.0",
            "c_user_occupation": "",
            "c_user_responseoptions": "",
            "addid": "140462",
            "groupid": 0,
            "c_user_text_test": "",
            "city": "Cincinnati",
            "isprimary": 1,
            "c_user_dmldate": "",
            "informalname": "",
            "c_user_felix_test_numbers": "",
            "c_user_dmlnum": 1,
            "title": "",
            "fax": "",
            "c_user_resume": "",
            "c_user_textforregularmbrs": ""
        },
        {
            "zip": "",
            "corpexpiration": "",
            "c_user_memo": "",
            "c_user_dmlnum2": "",
            "c_user_multiples2": "one,two,three",
            "firstname": "AffiniPay",
            "customid": "649",
            "c_user_felix_file": "",
            "email": "bob@barker.com",
            "contactid": "693681",
            "corptype": "",
            "country": "US",
            "c_user_test_default_no": false,
            "lastname": "eCheck",
            "c_user_dmlbool2": 1,
            "iscorp": 0,
            "corpjoindate": "",
            "id": "693681",
            "c_user_multiples": "one;two;three",
            "middle": "",
            "c_user_pets": "cats,monkeys",
            "c_user_photo": "",
            "orgid": "150514",
            "c_user_yesorno": false,
            "suffix": "",
            "creationdate": "2021-11-08 15:31:50.0",
            "modifiedby": "692686",
            "c_user_gender": "",
            "modifieddate": "2021-11-08 15:31:50.0",
            "isemail": 0,
            "c_user_graduationdate": "",
            "datedropped": "",
            "isactive": 1,
            "daterenewed": "",
            "company": "",
            "region": "",
            "c_user_birthday": "",
            "prefix": "",
            "c_user_torftrueisdefault": 1,
            "review": 0,
            "c_user_test": "",
            "c_user_certified": "",
            "ccmail": "",
            "c_user_uploadbio": "",
            "c_user_testing_true_false_now": 0,
            "phone": "jjkjkkk",
            "state": "OH",
            "paidthru": "",
            "c_user_end_market": "",
            "primarycontact": "693681",
            "url": "",
            "c_user_responseoptionsmistake": "",
            "member_status": "",
            "address1": "44j3j4j3k4k",
            "isdirectory": 1,
            "address3": "",
            "address2": "",
            "datejoined": "",
            "c_user_occupation": "",
            "c_user_responseoptions": "",
            "addid": "140467",
            "groupid": "693681",
            "c_user_text_test": "",
            "city": "kjkjkjkk",
            "isprimary": 1,
            "c_user_dmldate": "",
            "informalname": "",
            "c_user_felix_test_numbers": "",
            "c_user_dmlnum": 1,
            "title": "",
            "fax": "",
            "c_user_resume": "",
            "c_user_textforregularmbrs": ""
        }
    ],
    "error": "",
    "page": 1,
    "pagesize": "100"
}
Views Endpoint
POST /i4a/api2/views/