Add Contact(Async Mode)
This API allows the user to create a new user in CE, either individually or in a list in an async manner.
Overview
This endpoint allows users to add (or upsert) a contact record into Netcore’s contact database in asynchronous mode.
Region
Refer to the table given to learn the endpoints for all our regions.
Region | API Endpoint |
---|---|
US IDC | https://api.netcoresmartech.com/apiv2 |
Indian IDC | https://apiin.netcoresmartech.com/apiv2 |
EU IDC | https://jsonapi.eu-north-1.eu.netcoresmartech.com/apiv2 |
Method
POST
Example Code Snippet
This script adds a contact to your Netcore list using the API. You define what you're doing (type=contact, activity=add), authenticate using your API key, and send the contact’s details in the body.
import requests
import json
# Use appropriate API endpoint based on the region
url = "https://api.netcoresmartech.com/apiv2"
# Parameters that belong in the URL (Query Parameters)
query_params = {
"type": "contact",
"activity": "add",
"apikey": "xxxxxxxxxxxxxxxxxxxxxx" # Replace with your actual API key
}
# Data that belongs in the request body (Body Parameters)
# The API expects the 'data' value to be a JSON string.
body_params = {
"listid": 1,
"data": json.dumps({
"FIRST_NAME": "Testdoc",
"EMAIL": "[email protected]",
"MOBILE": 9999999999,
"CUSTOMER_ID": "00000132"
})
}
# The 'params' argument sends query parameters.
# The 'data' argument sends data in the request body.
response = requests.post(url, params=query_params, data=body_params)
# Check the response status code
if response.status_code == 200:
print("API call successful!")
print(response.text)
else:
print(f"API call failed with status code: {response.status_code}")
print(response.text)
Response
Success 200 OK
{
"requestid": "f1249cd84784d423ee163eca804a4eaa",
"result": "Success"
}
Parameters
Refer to the table to learn more about the parameters available in the code.
Parameter | Description | Data Type | Required | Parameter Type |
---|---|---|---|---|
type | Indicates the API module or resource category. For example, if the request is related to contacts, set the value to contact. Example value: contact | String | Yes | Query Parameter |
activity | Specifies the action to be performed by the API, such as add, update, or delete. Example value: add | String | Yes | Query Parameter |
apikey | Authentication key for API requests. Obtain it from the Netcore CE dashboard by enabling API Mode in Account Configuration > Advanced Details. Then, navigate to Sub Admin > Edit User to view your key. | String | Yes | Query Parameter |
listid | Unique identifier for a contact list in Netcore CE. Use this to specify the list to which the contact should be added. | Integer | Optional | Body Parameter |
data | Contains the input data in JSON format, including parameters like name, email, mobile, age, and city. The EMAIL field acts as the primary key. Example: { "NAME": "Mike", "EMAIL": "[email protected]", "MOBILE": 5654134, "AGE": 24, "CITY": "Mumbai" } | String | Yes | Body Parameter |
Updated 5 days ago