APIを利用して、お客様サーバー側のLINEユーザーのLINE UIDを指定してMessage Managerにユーザーを追加する方法
貴社の顧客基盤(CDPやCRMツールなど)から「end_users/add」APIを実行することで、Message Managerにユーザーを追加できます。
「end_users/add」API
指定した LINE ユーザーを登録します。
POST /v2/end_users
エラー定義 参照。
成功時に ステータスコード 201 Created と以下のプロパティを含む JSON オブジェクトを返します。
{
"end_user": {
"identifiers": [
{
"type": "line_uid",
"value": "U0123456789abcdef0123456789abcdef"
},
{
"type": "socialplus_uid",
"value": null
},
{
"type": "primary_key",
"value": null
}
]
}
}
ステータスコード 422 Unprocessable Content とともに、以下の内容を返します。
{
"errors": [
{
"path": "__global__",
"code": "line_uid_not_found"
}
]
}
"ユーザが LINE Messaging API チャネルから見つからない場合" とは、以下の状態を指します。
curl -L -X POST https://msgapi.socialplus.jp/v2/end_users \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Accept: application/json' \
-H "X-API-Key: {API Key}" \
--data-raw '{
"end_user": {
"identifier": {
"type": "line_uid",
"value": "U01234567890123456789012345678901"
}
}
}'
ソーシャルPLUSに関するお問い合わせやご相談など、お気軽にお問い合わせください。