Blacklist API for Email as a Channel (Async Mode)

This API can be used to blacklist email as a channel for users in the CE platform. If the user is already present in the platform, this API will simply update the blacklist status of the user. The user will not receive any further email communication from the platform. However, the user can still receive communication via other channels (SMS, APN and Web Push etc). If required communication handle exist.

If the user is not present in the platform, this API will add the user and also update the status as blacklist.

Details:

URL Schema:
US IDC: https://api.netcoresmartech.com/v3/contact/blacklist

URL Schema:
Indian IDC: https://apiin.netcoresmartech.com/v3/contact/blacklist

URL Schema:
EU IDC: https://goapiv3.eu-north-1.eu.netcoresmartech.com/v3/contact/blacklist

Header:

KeyValue
Content-Typeapplication/json

Parameter:

ParameterDescriptionData typeRequiredParameter type
activityActivity refers to the action that is being performed through the API, that is, add, delete, update, blacklist so on. Value here: blacklist StringYesQuery Parameter
api-keyYou can obtain the API key from the CE panel. Log in to your CE panel and go to Admin. Enable the API Mode in Account Configuration under Advance details. Now, go to User management and click Edit either on your user name or admin user. To retrieve your API key here.StringYesHeader Parameter
typeIt represents the module or group the API belongs to. For example, if the API 's functionality is related to Contacts, type is 'contact'.
Value here: Contact
StringNoQuery parameter
primarykeyIt represents the unique identification of the contact. For eg: email ID, client ID, mobile no etc.StringYesHeader parameter
channelIt represents the channel that needs to be blacklisted.
Value here: email.
Note: by default email channel will only get blacklisted irrespective
of whatever is the primary key
StringNoHeader parameter
dataData is the Post body containing the array of email ids, client ids, mobile numbers etc for eg:
{
"data": [
"[email protected]"
]
}
primary key is email id for the above example. If its client id, mobile number etc , the same needs to be passed.
JSON array of stringsYesBody parameter

Request:

'https://api.netcoresmartech.com/v3/contact/blacklist' \
--header 'api-key: 085164d1083970906270bb24e97a0b82' \
--header 'primarykey: email' \
--header 'channel: email' \
--header 'Content-Type: application/json' \
--data-raw '{
"data": [
"[email protected]"
]
}'

Example of array: You can pass maximum 1000 primary keys in one array at a time

'https://api.netcoresmartech.com/v3/contact/blacklist' \
--header 'api-key: 085164d1083970906270bb24e97a0b82' \
--header 'primarykey: email' \
--header 'channel: email' \
--header 'Content-Type: application/json' \
--data-raw '{
"data": [
"[email protected]",
"[email protected]",
"[email protected]",
]
}'

Response: 200 OK

{
 "message": "dd5d16cc-85ac-fe74-8894-fc7ff750806b",
 "status": 200
}

For blank apikey validation:

{
    "message": "api key can not be blank",
    "status": 400
    }

For blank primary key:

{
    "message": "primary key is mandatory and should be string",
    "status": 400
    }

For invalid api key:

{
    "message": "Invalid api key",
    "status": 401
 }

For data type of array and length equal to zero:

{
    "message": "data should be of type array and length greater than zero",
    "status": 400
}

For batch limit exceeding 1000:

{
    "message": "You have exceeded the batch limit of 1000",
    "status": 400
 }

📘

Note:

  • This API does not support mass blacklisting. That is primary key is mobile number, that has two contacts with same email ID but different contact number. Only the contact number which is passed, the email ID attributed to it will only get blacklisted.
  • To check if the email id is blacklisted or not, you can check the user status under audience>>All Contacts>>Blacklisted Contacts
  • Irrespective of whatever is the primary key, only email as a channel will get blacklisted
  • If invalid data is passed in array, the API will give success message as "200". But the same will not get blacklisted. You can request for the log or check on the UI under audience>>All Contacts>>Blacklisted Contacts