Update Participant Custom Fields
Version: 1.0
This API will help you update list custom fields of specific participant.
Authenticated access scopes: social.write_bot
Rule update custom fields
Maximum input list custom field length is 10 per 1 request.
Only custom field which created in Messenger Setting > Custom Fields can be added or updated. (Example: https://app.harasocial.com/chat_assistant/fb102154598372863/messenger_settings/general#customFields)
New participant's custom field will be add at the end of the list of participant/ Existed participant's Custom field will have value updated.
Maximum length of the custom field's value is 150.
Request URI
- PUT
https://apis.harasocial.com/social/participants/{participant_id}/custom_fields.json
Example Request
curl -X 'PUT' \
'https://apis.hara.vn/social/participants/3656416594379434/custom_fields.json?channel=facebook&page_id=102154598372863' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json-patch+json' \
-d '{
"custom_fields": [
{
"key": "test_string",
"value": "1662969111",
},
{
"key": "test_number",
"value": "1662969111"
},
{
"key": "test_date",
"value": "1662969111"
}
]
}'
Parameters
participant_id
: string
"participant_id" = "2560816460611111"
Page Scoped User ID (PSID) of a participant.
channel
: string
"channel" = "facebook"
Channel which participants belong to. Support values: facebook. (Only facebook is currently supported)
page_id
: string
"page_id" = "500725830264711"
Page Id which participants belong to
Body Parameters
custom_fields
: List<Custom Field Object
>
"custom_fields": [
{
"key": "test_string",
"value": "any string",
},
{
"key": "test_number",
"value": "1111111111"
},
{
"key": "test_date",
"value": "1662969111"
}
]
List Custom Fields. Maximum length is 10 per 1 request.
Custom Field Object
key
: string
"key": "test_date"
Key of custom field.
value
: string
"value": "1662969111"
Value of custom field.
Maximum length of value is 150.
There are 3 types of customfield:
- Text: string.
- DateTime: unix timestamp by seconds (example: 1662969111).
- Number: double.
Response
A successful Send Messages API request returns a JSON string containing status indicates that the request was passed validation and the system will process it.
Example
{
"data": {
"success": true
},
"has_error": false,
"error_code": null,
"error_message": null
}
Properties
data
: Success Object
"data": {
"success": true
}
The result of the action. See Success Object
below.
has_error
: bool
True if the request does not meet requirement or validation
error_code
: string
The error code information
error_message
: string
The error message information
Success Object
success
: bool
"success": true
Status indicates that action update list custom field is success