Set Contact Information

Last updated:2025-03-18

Contact information can be used as the target for channel outreach, such as App notifications, SMS, emails, WhatsApp, etc. When a user's contact information changes, this interface can be used to update it.

Setting contact information must be done based on the EUID.

Invocation Address

POST /v1/user/contact

Invocation Verification

The EngageLab REST API uses the verification method of HTTP Basic Authentication: Add Authorization to the HTTP Header:

Authorization: Basic ${base64_auth_string}
          Authorization: Basic ${base64_auth_string}

        
This code block in the floating window

The generation algorithm for the above base64_auth_string is: base64(api_key:api_secret)

  • The header name is "Authorization", and the value is the base64-converted "username:password" pair (with a colon in the middle).
  • In the scenario of the MA API, the username is the APIKey, and the password is the APISecret. Please add a data source of the API type in the data source to obtain the APIKey and API Secret.

Request Example

Request Header

> POST /v1/user/contact > Content-Type: application/json > Authorization: Basic N2Q0MzFlNDJkZmE2YTZkNjkzYWMyZDA0OjVlOTg3YWM2ZDJlMDRkOTVhOWQ4ZjBkMQ==
          > POST /v1/user/contact
> Content-Type: application/json
> Authorization: Basic N2Q0MzFlNDJkZmE2YTZkNjkzYWMyZDA0OjVlOTg3YWM2ZDJlMDRkOTVhOWQ4ZjBkMQ==

        
This code block in the floating window

Request Body

{ "euid":10362473, "contacts":{ "mobile_phone": "18023456879", "email": "12@gmail.com" } }
          {
    "euid":10362473,
    "contacts":{
        "mobile_phone": "18023456879",
        "email": "12@gmail.com"
    }
}

        
This code block in the floating window

Request Parameters

Field Type Required Description
euid Long Yes The unique user ID
contacts JSON Yes The key is the name of the contact information, and the value is the value of the contact information, both of which are of the string data type.
  • The currently supported contact information includes email, mobile_phone, landline_phone, whatsapp_phone
  • Return Parameters

    Field Type Required Description
    code Int Yes Whether the interface call is successful. 0 indicates success or partial success, and other values represent failure.
    message String Yes The description of the interface call result, an explanation of the return code.

    All Successful

    { "code": 0, "message": "success" }
              {
        "code": 0,
        "message": "success"
    }
    
            
    This code block in the floating window

    All Failed

    { "code": 0, "message": "success" }
              {
        "code": 0,
        "message": "success"
    }
    
            
    This code block in the floating window

    Error Codes

    Error Code Explanation of Error Code Solution
    40050 Interface authentication failed Confirm whether the secret key is correct
    55014 Contact information has already been set Please check if uniqueness is set
    在文档中心打开
    icon
    Contact Sales