An overview of Interakt’s Get Users API (Contacts Retrieval API)
Postman Collection for this API.
Whenever you get a new lead on WhatsApp via Interakt, you can now make sure that the details of that lead are passed on to your other CRMs / databases by using the Contacts Retrieval API. Simply add the API calls to your system’s code, or, use these API calls in connector platforms (like Integromat / Zapier) to sync Interakt with your SaaS-based CRMs.
Authentication: The authentication mechanism uses HTTP Basic Auth which requires you to send your API key prepended with the ‘Basic’ string. This value is passed in the header under ‘Authorization’ and the header key-pair will look like ‘Authorization: Basic <API Key>‘.
Please note: You can find the API key in your dashboard. Go to Settings > Developer Setting > Secret Key.
Query Parameters: There are 2 query parameters that can be included in the URL on which the API is to be called: https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100
Limit: Default value is 100. If the API response contains more than 100 contacts, then the field ‘has_next_page’ in the API response will be true and the API would then have to be called again, keeping the offset as 100.
Offset: Default value is 0.
Errors: Our API endpoint will return a 200 status code for all successful requests. 4xx errors will be shown for the following cases:
• If the authorization credentials have been entered incorrectly.
• If the query parameter ‘limit’ has been set as > 100
• If ‘val’ of ‘created_at_utc’ or ‘modified_at_utc’ is not in UTC format in the API payload
• If the properties ‘op’ or ‘supr_op’ have not been entered correctly
5xx errors will be shown in case of some internal errors.
How to call Get API on Interakt
For retrieving contacts which have been created on Interakt after 5 pm (IST) on 8-Sep-2021 , the following payload could be sent in the API call.
POST https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100
{
“filters”: [
{
“trait”: “created_at_utc”,
“op”: “gt”,
“val”: “2021-09-08T11:30:00.000Z”
}
]
}
For retrieving contacts which have been created on Interakt before 5 pm (IST) on 8-Sep-2021 , the following payload could be sent in the API call.
POST https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100
{
“filters”: [
{
“trait”: “created_at_utc”,
“op”: “lt”,
“val”: “2021-09-08T11:30:00.000Z”
}
]
}
For retrieving contacts which have been created on Interakt after 5 pm (IST) on 7-Sep-2021 and before 5 pm (IST) on 8-Sep-2021 , the following payload could be sent in the API call.
POST https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100
{
“filters”: [
{
“trait”: “created_at_utc”,
“op”: “gt”,
“val”: “2021-09-07T11:30:00.0000”
},
{
“trait”: “created_at_utc”,
“op”: “lt”,
“supr_op”: “and”,
“val”: “2021-09-08T11:30:00.0000”
}
]
}
For retrieving contacts which have been modified on Interakt after 5 pm (IST) on 8-Sep-2021 , the following payload could be sent in the API call.
POST https://api.interakt.ai/v1/public/apis/users/?offset=0&limit=100
{
“filters”: [
{
“trait”: “modified_at_utc”,
“op”: “gt”,
“val”: “2021-09-08T11:30:00.000Z”
}
]
}
Note: Always send the date time value in UTC format. If only date has been sent without time (example: 2021-09-08), the time will be assumed to be 00:00 hours.