The SCG API and the SCG portal enable the user to create a single contact and upload files with contacts information be referenced when sending SCG messages. This provides the functionality to store contacts information.
This document provides a step-by-step procedure to create a contact with Social Handler in SCG for later use when sending messages.
Creating a contact with social handler in SCG through the UI (SCG portal)
1. Log in to SDC portal:
2. Click on the Voice & Messaging Console menu option:
3. Select you SCG account and click Select button:
4. Click the Addressbook menu
5. Select Contacts option
6. Click the + New Contact button
7. Type the contact information and for the Social Handler click Social handler + button
8. Type the Social Handler for example: wa:+1346787XXXX@1813305XXXX
9. When ready, click the Save button
10. A contact created successfully message will be displayed
Your contact is now stored in the SCG Contacts and can be used in SCG messages.
Creating a contact with social handler in SCG through an SCG API call
To create a contact with Social Handler through the API you can execute the curl command:
curl --location --request \
POST 'https://api.syniverse.com/scg-external-api/api/v1/contacts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [TOKEN]' \
--data-raw '{
"birth_date": "1970-01-01T11:20:39.270Z",
"voice_preference": "NONE",
"social_handles": [
"wa:+447732130000@18133050000"
],
"first_name": "Jane",
"last_name": "Doe",
"primary_mdn": "44773213XXXX",
"primary_email_addr": "jane.doe@test.com",
"primary_addr_country": "GBR",
"extended_attributes": "{}"
}'
R/
{"id":"iEmwXVmT6YKYJQXeV6qlk"}
Sending a message using a contact
curl -L -X \
POST 'https://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer 6f25271a-aa01-3ef8-97c1-90bf5bc0af4b' \
-d '{
"from":"channel:1KJPMkuHQkair_o15etpmg",
"to":"contact:iEmwXVmT6YKYJQXeV6qlk",
"body":"This is a test message"
}'
For further information on how to upload contacts using the SCG API click How to programmatically upload/import Contacts to your Account
0 Comments