SMS/MMS Sample


Send Message to a Recipient
curl -X POST
-H "Authorization: Bearer TOKEN" 
-H "Content-Type: application/json" 
-d '{
"from":"",
"to":+14085551212,
"body":"Hello from Kolanator"
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/messages"
Send Message to a Contact
curl -X POST 
-H "Authorization: Bearer TOKEN" 
-H "Content-Type: application/json" 
-d '{
"from":"",
"to":["contact_ID"],
"body":"Hello from Kolanator"
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/message_requests"
        
Send Message using a Channel
curl -X POST 
-H "Authorization: Bearer TOKEN" 
-H "Content-Type: application/json" 
-d '{
"from":"channel:",
"to":["+15551231234"],
"body":""
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/message_requests"
        
Send MMS message to a Recipient
Uploading an Attachment
File (for MMS):
Create the attachment resource:
Request:
curl -X POST 
-H 'Authorization:Bearer TOKEN' 
-H 'Content-Type: application/json;charset=UTF-8' 
--data-binary
'{"name":"Wave_image","type":"image/jpeg","filename":"wave.jpg"}'
"https://api.syniverse.com/scg-external-api/api/v1/messaging/attachments"

Response: 
 {"id":"NHb8GCcdKO2vNowhjbUKL6"}
Create an Access token for the new Attachment resource:
Request:
  curl -X POST 
 -H 'Authorization:Bearer TOKEN' 
 -H 'Content-Type:application/json;charset=UTF-8' 
 --data-binary
'{"resource":"ATTACHMENT","resource_id":"NHb8GCcdKO2vNowhjbUKL6"}
  "https://api.syniverse.com/scg-external-api/api/v1/access_tokens"
Response:
{"id":"f0NdNhWMUFk30f9eq9wO65"}

Upload the Attachment content using the access token:
   curl
'https://api.syniverse.com/scg-attachment/api/v1/messaging/attachments/f0NdNhWMUFk30f9eq9wO65/content'
-X POST --data-binary @"/cygdrive/c/DDD.jpg" -H "Content-Type:
application/octet-stream"

Send a MMS message using SenderId:
curl -X POST 
-H "Authorization:Bearer {TOKEN}" 
-H "Content-Type:application/json" 
-d '{
"from":"{SENDER_ID}",
"to":["+14085551212"],
"body":"Hello!",
"attachments":["NHb8GCcdKO2vNowhjbUML6"]
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/messages"
        
Create a SMS capable Sender ID
curl -X POST-H
"Authorization: Bearer TOKEN" 
-H
"Content-Type: application/json" 
-d '{
"name":"My First shortcode",
"class_id":"COMMERCIAL",
"type_id":"SHORTCODE",
"address":"<22222>",
"country":"USA",
"consent_managed_by":"USER",
"capabilities":["SMS"]
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/sender_ids"
List Sender ID
curl -X GET 
-H
"Authorization: Bearer TOKEN" 
"https://api.syniverse.com/scg-external-api/api/v1/messaging/sender_ids"
Delete Sender ID
curl -X DELETE-H
"Authorization: Bearer TOKEN"
"https://api.syniverse.com/scg-external-api/api/v1/messaging/sender_ids/{Sender_ID}

Create a Private Channel
curl -X POST
-H "Authorization: Bearer TOKEN" 
-H "Content-Type: application/json" 
-d '{
"name":"Europe Channel",
"description":"My European Channel",
"priority":""
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/channels"
Add Sender ID to a Channel
curl -X POST
-H "Authorization: Bearer TOKEN" 
-H "Content-Type: application/json" 
-d '{
"sender_ids":[""]
}' "https://api.syniverse.com/scg-external-api/api/v1/messaging/channels/{Channel_ID}/sender_ids"