獲取 EUID

最新更新:2025-03-18

EUID 為 EngageLab MA 平台的用戶唯一ID,您可以使用下述 API 基於用戶標識獲取 EUID

調用地址

POST /v1/user/register

調用驗證

EngageLab REST API 採用 HTTP 基本認證 的驗證方式:HTTP Header(頭)里加 Authorization:

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

        
此代碼塊在浮窗中顯示

上述 base64_auth_string 的生成算法為:base64(api_key:api_secret)

  • Header 名稱是 "Authorization",值是 base64 轉換過的 "username:password" 對(中間有個冒號)。
  • 在 MA API 的場景里,username 是 APIKey,password 是 APISecret。請在數據來源中添加 API 類型的數據源獲得 APIKey 與 API Secret。

請求示例

請求頭

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

        
此代碼塊在浮窗中顯示

請求體

{ "identity_name":"user_id", //用戶標識名稱 "identity_values": [ "18012345678", //用戶標識value值 "18012345678" ] }
          {
    "identity_name":"user_id", //用戶標識名稱
    "identity_values": [
        "18012345678",    //用戶標識value值
        "18012345678"
        ]
}

        
此代碼塊在浮窗中顯示

請求參數

字段 類型 必填 描述
identity_name String 用戶標識名稱,支持傳值 user_id、 anonymous_id、registration_id
identity_values list 用戶標識的值,最多支持 100 個值,每個值不能超過 256 個字符

返回參數

字段 類型 必填 描述
code Int 接口調用是否成功,0表示成功或者部分成功,其他值代表失敗
message String 接口調用結果描述,對返回碼的說明
data Array 返回用戶標識對應的 EUID 列表
identity_value String 用戶標識的值
euid Long 對應 EngageLab MA 用戶唯一ID
error_code Int EUID 是否獲取成功,0 代表成功,其他值代表失敗

全部成功

{ "code": 0, "message": "success", "data": [ { "identity_value": "18012345678", //用戶標識value值 "euid": 10362473, //生成的EUID,獲取失敗時為 null 值 "error_code": 0 //對應的錯誤碼,成功是為0,失敗時不為空,例如 40006 }, { "identity_value": "18012340000", "euid": 10362474, "error_code": 0 } ] }
          {
    "code": 0,
    "message": "success",
    "data": [
        {
            "identity_value": "18012345678",   //用戶標識value值
            "euid": 10362473, //生成的EUID,獲取失敗時為 null 值
            "error_code": 0   //對應的錯誤碼,成功是為0,失敗時不為空,例如 40006
        },
        {
            "identity_value": "18012340000",
            "euid": 10362474,
            "error_code": 0
        }
    ]
}

        
此代碼塊在浮窗中顯示

全部失敗

{ "code": 55101, "message": "Exceeded the limit of user identifiers" }
          {
    "code": 55101,
    "message": "Exceeded the limit of user identifiers"
}

        
此代碼塊在浮窗中顯示

部分成功

{ "code": 0, "message": "success", "data": [ { "identity_value": "18012345678", //用戶標識value值 "euid": null, //失敗為null值 "error_code": -1 //對應的錯誤碼,成功是為0,失敗時不為空 }, { "identity_value": "180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000", "euid": null, "error_code": 55105 } ] }
          {
    "code": 0,
    "message": "success",
    "data": [
        {
            "identity_value": "18012345678",   //用戶標識value值
            "euid": null, //失敗為null值
            "error_code": -1     //對應的錯誤碼,成功是為0,失敗時不為空
        },
        {
            "identity_value": "180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000180123400001801234000018012340000",
            "euid": null,
            "error_code": 55105
        }
    ]
}

        
此代碼塊在浮窗中顯示
在文档中心打开
icon
聯繫銷售