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.

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.

ParameterDescriptionData TypeRequiredParameter Type
typeIndicates the API module or resource category. For example, if the request is related to contacts, set the value to contact.
Example value: contact
StringYesQuery Parameter
activitySpecifies the action to be performed by the API, such as add, update, or delete.
Example value: add
StringYesQuery Parameter
apikeyAuthentication 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.StringYesQuery Parameter
listidUnique identifier for a contact list in Netcore CE. Use this to specify the list to which the contact should be added.IntegerOptionalBody Parameter
dataContains 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" }
StringYesBody Parameter