This API can be used to blacklist email as a channel for users in the Customer Engagement platform. If the user is already present within the platform, the API will 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.) i.e. If the required communication handle exists. If the user is not present on the platform, the API will add the user and shall update the status as a blacklist.


Details


URL Schema:

US IDC:


https://api.netcoresmartech.com/v3/contact/blacklist


Indian IDC:


https://apiin.netcoresmartech.com/v3/contact/blacklist


Method:

POST


Header:

KEY
VALUE
Content-Typeapplication/json


Parameters:




PARAMETER
DESCRIPTION
DATA TYPE
REQUIRED
PARAMETER TYPE
activityActivity refers to the action that is being performed through the API, that is, add, delete, update, blacklist and so on Value here: blacklistStringRequiredQuery Parameter

 primarykey

 It represents the unique identification of the contact. For eg: EMAIL, CLIENT_ID, MOBILE, etc.

StringRequiredHeader Parameter

 channel

It represents the channel that needs to be blacklisted. Note: by default email channel will only get blacklisted irrespective of whatever is the primary key. Value here: email.                                      

StringOptionalHeader Parameter
api-keyYou can obtain the API key from the CEE panel. Log in to your CEE panel and go to Admin. Enable the API Mode in Account Configuration under Advance details. Now, go to Sub Admin and click Edit on your user name. You can view your API key here.StringRequiredHeader Parameter
typeIt represents the module or group the API belongs to. For example, if the API's functionality is related to Contacts, the type is 'contact'.
Value here: contact                      
StringOptionalQuery Parameter
data
                       

Data is the post body raw parameters containing the array of primary keys. You can pass a maximum of 1000 primary keys in one array at a time.

 For eg:                                                                        

 {                                              

 "data": [                                            "sajeed_test12@m.pragatee.com"  ]                                               

 }


The primary key is EMAIL for the above example. 


 String                         

RequiredBody Parameter



Example: Using a single primary key


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": [

"sajeed_test12@m.pragatee.com"

]

}'



Response:

Success: 200 OK

{

"message": "dd5d16cc-85ac-fe74-8894-fc7ff750806b",

"status": 200

}



Example of the array: You can pass a maximum of 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": [

"sajeed_test12@m.example.com",

"amrutadeshmukh1_test15@example.com",

"amrutadeshmukh1_test123@example.com",

]

}'



Status and the Error Message for the Blacklist API call


For blank API key validation:


{

"message": "api key can not be blank",

"status": 400

}



For blank primary key:


{

"message": "primary key is mandatory and should be the 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

}




* This API does not support mass blacklisting. That is if the primary key is a mobile number that has two contacts with the same email ID but different contact numbers. 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 an array, the API will give a success message as "200". But the same will not get blacklisted. You can request the log or check on the UI under audience>>All Contacts>>Blacklisted Contacts