Introduction
Dive into our full API Reference Documentation and seamlessly integrate Voice and SMS functionalities into your website or application. This API uses HTTP verbs and a RESTful endpoint structure. Your Account SID and Auth Token is used as the API Authorization framework. Request and response payloads are formatted as JSON using UTF-8 encoding and URL encoded values.
Make an HTTP Request
There are a lot of ways you can make an HTTP request to Somleng. You can use a Helper Library or SDK for your preferred programming language or you can make a raw HTTP request in your code by using a tool like Postman.
Credentials
All requests to Somleng need to be authenticated. Somleng using HTTP basic auth, which use the following username/password schemes:
Account SID and Auth Token
The account SID and auth token are the master keys to your account.
Username | Password |
---|---|
AccountSid | AuthToken |
Store Your Somleng Credentials Securely
It's important to keep credentials such as your Somleng Account SID and Auth token secure by storing them in a way that prevents unauthorized access. One common method is to store them in environment variables which are then accessed from your app. This keeps them out of code and other places where credentials don't belong.
On the right is an example in Node.js ---->
const accountSid = process.env.SOMLENG_ACCOUNT_SID;
const authToken = process.env.SOMLENG_AUTH_TOKEN;
const client = require('somleng')(accountSid, authToken);
// Make API calls here...
Helper Libraries
The following is a list of officially supported helper libraries for Somleng. Please refer to the documentation in each library for more details.
Demo Applications
The following is a list of demo applications which you can use to get started with Somleng.
Accounts
Fetch an account
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562" -X GET \
-u a5925a8a-cbe0-4c59-8b29-e476769d6562:nAatWI_8mrf4mzFx8lURZGgWYRMC8FP3krEx8jzmXeA
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:sid
GET https://api.somleng.org/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562
Parameters
None known.
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "a5925a8a-cbe0-4c59-8b29-e476769d6562",
"date_created": "Thu, 18 Apr 2024 07:39:35 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:35 -0000",
"auth_token": "nAatWI_8mrf4mzFx8lURZGgWYRMC8FP3krEx8jzmXeA",
"friendly_name": "Rocket Rides",
"owner_account_sid": "a5925a8a-cbe0-4c59-8b29-e476769d6562",
"status": "active",
"type": "Full",
"uri": "/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562",
"subresource_uris": {
"calls": "/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562/Calls",
"messages": "/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562/Messages",
"recordings": "/2010-04-01/Accounts/a5925a8a-cbe0-4c59-8b29-e476769d6562/Recordings"
}
}
Recordings
List recordings by account
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Recordings" -X GET \
-u 37cc1d58-0913-4056-b052-a86b946be3fb:l-12GxZ9WMudvF_Nmu4tdN3qdQrZFf42NCsEN2tpvtI
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings
GET https://api.somleng.org/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Recordings
Parameters
None known.
Response
200 OK
{
"recordings": [
{
"api_version": "2010-04-01",
"sid": "17084711-59ec-4516-b81b-a159c2eebd5f",
"date_created": "Thu, 18 Apr 2024 07:39:39 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:39 -0000",
"account_sid": "37cc1d58-0913-4056-b052-a86b946be3fb",
"call_sid": "759926aa-c97d-4494-b99c-39a48f2a95c2",
"conference_sid": null,
"channels": 1,
"start_time": "2024-04-18T07:39:39.736Z",
"duration": null,
"price": null,
"price_unit": null,
"source": "RecordVerb",
"status": "processing",
"error_code": null,
"encryption_details": null,
"track": "both",
"uri": "/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Calls/759926aa-c97d-4494-b99c-39a48f2a95c2/Recordings/17084711-59ec-4516-b81b-a159c2eebd5f.json"
},
{
"api_version": "2010-04-01",
"sid": "d930c72d-b2b1-44ac-a112-958c4610d5cb",
"date_created": "Thu, 18 Apr 2024 07:39:39 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:39 -0000",
"account_sid": "37cc1d58-0913-4056-b052-a86b946be3fb",
"call_sid": "4f8dd686-1e8e-4667-8d63-44e4600b8212",
"conference_sid": null,
"channels": 1,
"start_time": "2024-04-18T07:39:39.717Z",
"duration": null,
"price": null,
"price_unit": null,
"source": "RecordVerb",
"status": "processing",
"error_code": null,
"encryption_details": null,
"track": "both",
"uri": "/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Calls/4f8dd686-1e8e-4667-8d63-44e4600b8212/Recordings/d930c72d-b2b1-44ac-a112-958c4610d5cb.json"
}
],
"uri": "/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Recordings",
"page": 0,
"page_size": 50,
"first_page_uri": "/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Recordings?Page=0",
"previous_page_uri": "/2010-04-01/Accounts/37cc1d58-0913-4056-b052-a86b946be3fb/Recordings?Page=0&PageToken=PB17084711-59ec-4516-b81b-a159c2eebd5f",
"next_page_uri": null
}
Fetch a recording as mp3
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/b7447728-1098-473a-8fa5-0e0a2a3a01c7/Recordings/9e774870-e2cd-4e52-aea8-f7e2735434ea.mp3" -X GET
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid.mp3
GET https://api.somleng.org/2010-04-01/Accounts/b7447728-1098-473a-8fa5-0e0a2a3a01c7/Recordings/9e774870-e2cd-4e52-aea8-f7e2735434ea.mp3
Parameters
None known.
Response
302 Found
Fetch a recording resource
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/7388967e-bbbc-49f3-abe6-2667cf90f192/Recordings/9954790b-933b-4366-9594-81c0e5e86508.json" -X GET
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid.json
GET https://api.somleng.org/2010-04-01/Accounts/7388967e-bbbc-49f3-abe6-2667cf90f192/Recordings/9954790b-933b-4366-9594-81c0e5e86508.json
Parameters
None known.
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "9954790b-933b-4366-9594-81c0e5e86508",
"date_created": "Thu, 18 Apr 2024 07:39:39 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:39 -0000",
"account_sid": "7388967e-bbbc-49f3-abe6-2667cf90f192",
"call_sid": "59d38673-5c3e-4b5e-8ba9-11eee3c6b81a",
"conference_sid": null,
"channels": 1,
"start_time": "2024-04-18T07:39:39.890Z",
"duration": null,
"price": null,
"price_unit": null,
"source": "RecordVerb",
"status": "processing",
"error_code": null,
"encryption_details": null,
"track": "both",
"uri": "/2010-04-01/Accounts/7388967e-bbbc-49f3-abe6-2667cf90f192/Calls/59d38673-5c3e-4b5e-8ba9-11eee3c6b81a/Recordings/9954790b-933b-4366-9594-81c0e5e86508.json"
}
List recordings by call
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings" -X GET \
-u e8554317-b476-4a8c-99b7-40c7103e81ad:kwf_yA9ogWeq91-OjXaYK3Z8IMTFRvNxjzZpUvAMLkE
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:call_sid/Recordings
GET https://api.somleng.org/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings
Parameters
None known.
Response
200 OK
{
"recordings": [
{
"api_version": "2010-04-01",
"sid": "495e5b69-dfa9-48bc-b6c6-9b54d1af0e79",
"date_created": "Thu, 18 Apr 2024 07:39:39 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:39 -0000",
"account_sid": "e8554317-b476-4a8c-99b7-40c7103e81ad",
"call_sid": "de750c4f-925d-404b-b23c-13a0e7b257a1",
"conference_sid": null,
"channels": 1,
"start_time": "2024-04-18T07:39:39.929Z",
"duration": "0",
"price": null,
"price_unit": null,
"source": "RecordVerb",
"status": "completed",
"error_code": null,
"encryption_details": null,
"track": "both",
"uri": "/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings/495e5b69-dfa9-48bc-b6c6-9b54d1af0e79.json"
}
],
"uri": "/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings",
"page": 0,
"page_size": 50,
"first_page_uri": "/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings?Page=0",
"previous_page_uri": "/2010-04-01/Accounts/e8554317-b476-4a8c-99b7-40c7103e81ad/Calls/de750c4f-925d-404b-b23c-13a0e7b257a1/Recordings?Page=0&PageToken=PB495e5b69-dfa9-48bc-b6c6-9b54d1af0e79",
"next_page_uri": null
}
Fetch a recording
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/1818fec7-a0fd-4505-9e77-7e20902e6cd0/Recordings/8fea9709-2f7b-4ad5-a168-6137d2849fcf" -X GET
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid
GET https://api.somleng.org/2010-04-01/Accounts/1818fec7-a0fd-4505-9e77-7e20902e6cd0/Recordings/8fea9709-2f7b-4ad5-a168-6137d2849fcf
Parameters
None known.
Response
302 Found
Verifications
Manually mark the verification as approved
after your application had validated the verification code or
mark the verification as canceled
to start a new verification session with a different code
before the previous code expires (10 minutes). Only recommended during testing or if you're using custom verification codes.
For most other use cases, Verify is able to manage the complete lifecycle of a verification with the Verification Check Resource.
Update a Verification Status
Request
curl "https://verify.somleng.org/v2/Services/92ddb2fa-9b11-4788-ad56-80a391dbf08a/Verifications/32e2dbf6-67ec-4b2d-8b12-4ee7bad6f6b4" -d 'Status=approved' -X POST \
-u 037c2112-e4e9-416d-8ef0-b8125084f649:Qzh0gxI_21Bccuklzn5yN49wqFaJYcMX1TSUDxDmUGM \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:service_sid/Verifications/:sid
POST https://verify.somleng.org/v2/Services/92ddb2fa-9b11-4788-ad56-80a391dbf08a/Verifications/32e2dbf6-67ec-4b2d-8b12-4ee7bad6f6b4
Parameters
Status=approved
Name | Description |
---|---|
ServiceSid required | The SID of the verification Service to create the resource under. |
Sid required | The SID of the Verification resource to update. |
To required | The phone number or email to verify. Phone numbers must be in E.164 format. |
Status required | The new status of the resource. Can be: canceled or approved . |
Response
200 OK
{
"sid": "32e2dbf6-67ec-4b2d-8b12-4ee7bad6f6b4",
"account_sid": "037c2112-e4e9-416d-8ef0-b8125084f649",
"date_created": "2024-04-18T07:39:40Z",
"date_updated": "2024-04-18T07:39:40Z",
"service_sid": "92ddb2fa-9b11-4788-ad56-80a391dbf08a",
"to": "+85512334667",
"channel": "sms",
"status": "approved",
"url": "http://verify.lvh.me/v2/Services/92ddb2fa-9b11-4788-ad56-80a391dbf08a/Verifications/32e2dbf6-67ec-4b2d-8b12-4ee7bad6f6b4",
"send_code_attempts": [
]
}
Start New SMS Verification
Request
curl "https://verify.somleng.org/v2/Services/af09b713-8031-41bf-9560-291079de1cc8/Verifications" -d 'To=%2B85512334667&Channel=sms' -X POST \
-u 696edaa4-a511-40ab-8cff-e7abb707f605:JKX0HniTYPgrKKWwCjNzYbhUU7Ll4aXgosnXQE3L8QQ \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:service_sid/Verifications
POST https://verify.somleng.org/v2/Services/af09b713-8031-41bf-9560-291079de1cc8/Verifications
Parameters
To=%2B85512334667&Channel=sms
Name | Description |
---|---|
ServiceSid required | The SID of the verification Service to create the resource under. |
To required | The phone number or email to verify. Phone numbers must be in E.164 format. |
Channel required | The verification method to use. One of: sms or call |
Locale | Locale will automatically resolve based on phone number country code of the recipient for SMS and call channel verifications. It will fallback to English if the selected translation is not available. This parameter will override the automatic locale resolution. The following locales are supported: en , fr , ja , nl , ar , ca , da , de , es , fi , id , it , ko , pl , pt , ru , sv , tr , uk , vi , af , cs , el , hi , hr , hu , km , kn , lt , mr , ms , nb , pt-br , ro , sk , te , th , tl , zh-cn , zh-hk , zh . |
Response
200 OK
{
"sid": "4719616d-54cd-47f9-96c0-0e0bc777943d",
"account_sid": "696edaa4-a511-40ab-8cff-e7abb707f605",
"date_created": "2024-04-18T07:39:40Z",
"date_updated": "2024-04-18T07:39:40Z",
"service_sid": "af09b713-8031-41bf-9560-291079de1cc8",
"to": "+85512334667",
"channel": "sms",
"status": "pending",
"url": "http://verify.lvh.me/v2/Services/af09b713-8031-41bf-9560-291079de1cc8/Verifications/4719616d-54cd-47f9-96c0-0e0bc777943d",
"send_code_attempts": [
{
"attempt_sid": "3f212bfb-99c3-4495-9e8a-31982babecfc",
"channel": "sms",
"time": "2024-04-18T07:39:40Z"
}
]
}
Start New Call Verification
Request
curl "https://verify.somleng.org/v2/Services/e6ef2d79-663b-4949-a0ed-261e30948d00/Verifications" -d 'To=%2B85512334667&Channel=call' -X POST \
-u d1eb718b-6532-4ab0-8321-87a70b5d1140:UQIf45Tr9OAIOIEmc0tBAplWXrOMRgMf7ESsdDRbGU4 \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:service_sid/Verifications
POST https://verify.somleng.org/v2/Services/e6ef2d79-663b-4949-a0ed-261e30948d00/Verifications
Parameters
To=%2B85512334667&Channel=call
Name | Description |
---|---|
ServiceSid required | The SID of the verification Service to create the resource under. |
To required | The phone number or email to verify. Phone numbers must be in E.164 format. |
Channel required | The verification method to use. One of: sms or call |
Locale | Locale will automatically resolve based on phone number country code of the recipient for SMS and call channel verifications. It will fallback to English if the selected translation is not available. This parameter will override the automatic locale resolution. The following locales are supported: en , fr , ja , nl , ar , ca , da , de , es , fi , id , it , ko , pl , pt , ru , sv , tr , uk , vi , af , cs , el , hi , hr , hu , km , kn , lt , mr , ms , nb , pt-br , ro , sk , te , th , tl , zh-cn , zh-hk , zh . |
Response
200 OK
{
"sid": "7336cbaf-f2ba-4dd5-bb6c-0d6ee7269a2e",
"account_sid": "d1eb718b-6532-4ab0-8321-87a70b5d1140",
"date_created": "2024-04-18T07:39:40Z",
"date_updated": "2024-04-18T07:39:40Z",
"service_sid": "e6ef2d79-663b-4949-a0ed-261e30948d00",
"to": "+85512334667",
"channel": "call",
"status": "pending",
"url": "http://verify.lvh.me/v2/Services/e6ef2d79-663b-4949-a0ed-261e30948d00/Verifications/7336cbaf-f2ba-4dd5-bb6c-0d6ee7269a2e",
"send_code_attempts": [
{
"attempt_sid": "f07626f9-1a29-4515-a9c8-28b3550a5f0d",
"channel": "call",
"time": "2024-04-18T07:39:40Z"
}
]
}
Fetch a Verification
Request
curl -g "https://verify.somleng.org/v2/Services/b4e080b0-3967-4af6-ad59-8fa55e34957e/Verifications/9cc80061-d01b-4dab-a13b-8ba332a66f00" -X GET \
-u 2fa1c521-3ebe-4d6e-b973-3eb65c4b5d16:4MMWtCPGPVtkTXtVC2-7rrkEFvjxbvjgodYjI5kCxwM
Endpoint
GET https://verify.somleng.org/v2/Services/:service_sid/Verifications/:sid
GET https://verify.somleng.org/v2/Services/b4e080b0-3967-4af6-ad59-8fa55e34957e/Verifications/9cc80061-d01b-4dab-a13b-8ba332a66f00
Parameters
None known.
Response
200 OK
{
"sid": "9cc80061-d01b-4dab-a13b-8ba332a66f00",
"account_sid": "2fa1c521-3ebe-4d6e-b973-3eb65c4b5d16",
"date_created": "2024-04-18T07:39:40Z",
"date_updated": "2024-04-18T07:39:40Z",
"service_sid": "b4e080b0-3967-4af6-ad59-8fa55e34957e",
"to": "+85512334667",
"channel": "sms",
"status": "pending",
"url": "http://verify.lvh.me/v2/Services/b4e080b0-3967-4af6-ad59-8fa55e34957e/Verifications/9cc80061-d01b-4dab-a13b-8ba332a66f00",
"send_code_attempts": [
]
}
Check a Verification with a SID
Request
curl "https://verify.somleng.org/v2/Services/dc0c9df4-5655-42dc-af42-0bc07abdd945/VerificationCheck" -d 'VerificationSid=e5e95043-c81b-454e-9f63-9e1f71a7f0ce&Code=1234' -X POST \
-u fa234a1d-9f76-4c72-80bf-b3cd9bf0e417:l7DH1UaKxpsAwUJT9HJqvjz-0wF2s0yuyRv_4iYWQsI \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:service_sid/VerificationCheck
POST https://verify.somleng.org/v2/Services/dc0c9df4-5655-42dc-af42-0bc07abdd945/VerificationCheck
Parameters
VerificationSid=e5e95043-c81b-454e-9f63-9e1f71a7f0ce&Code=1234
Name | Description |
---|---|
ServiceSid required | The SID of the verification Service to create the resource under. |
Code | The 4-10 character string being verified. |
To | The phone number or email to verify. Either this parameter or the verification_sid ` must be specified. Phone numbers must be in E.164 format. |
VerificationSid | A SID that uniquely identifies the Verification. Either this parameter or the To phone number/email must be specified. |
Response
200 OK
{
"sid": "e5e95043-c81b-454e-9f63-9e1f71a7f0ce",
"account_sid": "fa234a1d-9f76-4c72-80bf-b3cd9bf0e417",
"date_created": "2024-04-18T07:39:41Z",
"date_updated": "2024-04-18T07:39:41Z",
"service_sid": "dc0c9df4-5655-42dc-af42-0bc07abdd945",
"to": "+85512334667",
"channel": "sms",
"status": "approved"
}
Check a Verification with a Phone Number
Request
curl "https://verify.somleng.org/v2/Services/0454322c-8171-493f-8f73-3a6c06b3747a/VerificationCheck" -d 'To=%2B85512334667&Code=1234' -X POST \
-u 45c8d628-4eb6-4252-b0ec-e6a79d29a648:tJ2-7ei4v-_WIW0IEAifYW_ZCa44gKzlfVEH2Mmp22Y \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:service_sid/VerificationCheck
POST https://verify.somleng.org/v2/Services/0454322c-8171-493f-8f73-3a6c06b3747a/VerificationCheck
Parameters
To=%2B85512334667&Code=1234
Name | Description |
---|---|
ServiceSid required | The SID of the verification Service to create the resource under. |
Code | The 4-10 character string being verified. |
To | The phone number or email to verify. Either this parameter or the verification_sid ` must be specified. Phone numbers must be in E.164 format. |
VerificationSid | A SID that uniquely identifies the Verification. Either this parameter or the To phone number/email must be specified. |
Response
200 OK
{
"sid": "f411dea2-2b0a-4389-8ce6-4b152cf1844b",
"account_sid": "45c8d628-4eb6-4252-b0ec-e6a79d29a648",
"date_created": "2024-04-18T07:39:41Z",
"date_updated": "2024-04-18T07:39:41Z",
"service_sid": "0454322c-8171-493f-8f73-3a6c06b3747a",
"to": "+85512334667",
"channel": "sms",
"status": "approved"
}
Messages
Updates the body of a message resource or cancels a scheduled message.
Redacting a message
This action can be used to redact messages: to do so, POST to the above URI and set the
Body
parameter as an empty string: "". This will allow you to effectively redact the text of a message
while keeping the other message resource properties intact.
Canceling a scheduled message
Before you use this functionality:
- Ensure the status value of canceled is spelled with one "l", (canceled) and not two (cancelled).
- Ensure that you store the
MessageSid
of the messages you schedule. You need to reference theMessageSid
for each message cancelation request. - There is no bulk cancelation. If you'd like to cancel multiple messages, you must send in a cancelation request for each message and reference the
MessageSid
. - There is a new status callback event for
Canceled
. You can continue to receive existing callback events by including the optionalStatusCallBack
parameter in the message request.
Cancel a scheduled message
Request
curl "https://api.somleng.org/2010-04-01/Accounts/8300232f-c506-4dd7-9a33-4228f4f65e0f/Messages/5ad0e38d-defd-4431-a33a-618517c84eec" -d 'Status=canceled' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 8300232f-c506-4dd7-9a33-4228f4f65e0f:QN-uk3sPoc1iyZ6zfyY3Q-WhvWOAjGgAf5EA1fgbAkc
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid
POST https://api.somleng.org/2010-04-01/Accounts/8300232f-c506-4dd7-9a33-4228f4f65e0f/Messages/5ad0e38d-defd-4431-a33a-618517c84eec
Parameters
Status=canceled
Name | Description |
---|---|
AccountSid required | The SID of the Account that created the Message resources to update. |
Sid required | The ID that uniquely identifies the Message resource to update. |
Body | Must be an empty string (""). Required for redacting a message |
Status | When set as canceled , allows a message cancelation request if a message has not yet been sent. |
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "5ad0e38d-defd-4431-a33a-618517c84eec",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "8300232f-c506-4dd7-9a33-4228f4f65e0f",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": null,
"messaging_service_sid": "66f223f2-62f5-4d22-82ee-68587dfed170",
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "canceled",
"subresource_uris": {
},
"tags": {
},
"to": "+85512334667",
"uri": "/2010-04-01/Accounts/8300232f-c506-4dd7-9a33-4228f4f65e0f/Messages/5ad0e38d-defd-4431-a33a-618517c84eec"
}
Redact a message
Request
curl "https://api.somleng.org/2010-04-01/Accounts/893bbf61-b66e-4dbf-b8bd-7113597d0b2a/Messages/57e0103d-7b7f-404f-b3f3-e11254475dd0" -d 'Body=' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 893bbf61-b66e-4dbf-b8bd-7113597d0b2a:k2CPgQDbXBHFPkgOnwIT7yPx9Orh9dTPAUL0INJ9VnY
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid
POST https://api.somleng.org/2010-04-01/Accounts/893bbf61-b66e-4dbf-b8bd-7113597d0b2a/Messages/57e0103d-7b7f-404f-b3f3-e11254475dd0
Parameters
Body=
Name | Description |
---|---|
AccountSid required | The SID of the Account that created the Message resources to update. |
Sid required | The ID that uniquely identifies the Message resource to update. |
Body | Must be an empty string (""). Required for redacting a message |
Status | When set as canceled , allows a message cancelation request if a message has not yet been sent. |
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "57e0103d-7b7f-404f-b3f3-e11254475dd0",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "893bbf61-b66e-4dbf-b8bd-7113597d0b2a",
"body": "",
"date_sent": "Thu, 18 Apr 2024 07:39:43 -0000",
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "2442",
"messaging_service_sid": null,
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "sent",
"subresource_uris": {
},
"tags": {
},
"to": "+85512334667",
"uri": "/2010-04-01/Accounts/893bbf61-b66e-4dbf-b8bd-7113597d0b2a/Messages/57e0103d-7b7f-404f-b3f3-e11254475dd0"
}
Delete a message
Request
curl "https://api.somleng.org/2010-04-01/Accounts/627bd12c-9942-4d44-9f34-7cdfb4dd823c/Messages/3cbd520f-b49e-46da-a07c-1865146a70bf" -d '' -X DELETE \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 627bd12c-9942-4d44-9f34-7cdfb4dd823c:oZVHTI0jG3zbRFRTDxb1GaZJywqMx2QNnjdKE1u0tZo
Endpoint
DELETE https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid
DELETE https://api.somleng.org/2010-04-01/Accounts/627bd12c-9942-4d44-9f34-7cdfb4dd823c/Messages/3cbd520f-b49e-46da-a07c-1865146a70bf
Parameters
Name | Description |
---|---|
AccountSid required | The SID of the Account that created the Message resources to delete. |
Sid required | The ID that uniquely identifies the Message resource to delete. |
Response
204 No Content
Fetch a message
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/77bd3fe9-fe1f-478a-9f49-39524ab26f0a/Messages/1818dec0-054c-470d-9a68-68c42361a19b" -X GET \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 77bd3fe9-fe1f-478a-9f49-39524ab26f0a:npfAm-1Lgp5FNySlhV-za-wnONbu0cY-XtdxClceIzg
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid
GET https://api.somleng.org/2010-04-01/Accounts/77bd3fe9-fe1f-478a-9f49-39524ab26f0a/Messages/1818dec0-054c-470d-9a68-68c42361a19b
Parameters
None known.
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "1818dec0-054c-470d-9a68-68c42361a19b",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "77bd3fe9-fe1f-478a-9f49-39524ab26f0a",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "2442",
"messaging_service_sid": null,
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "accepted",
"subresource_uris": {
},
"tags": {
},
"to": "+85512334667",
"uri": "/2010-04-01/Accounts/77bd3fe9-fe1f-478a-9f49-39524ab26f0a/Messages/1818dec0-054c-470d-9a68-68c42361a19b"
}
List messages
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages" -X GET \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 92eb9d26-69e5-4e63-9a57-00421a46ab41:UX2J5q5FbJp8ZAftjRmV7oXfhCKbTWB259qPS3L6fvo
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages
GET https://api.somleng.org/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages
Parameters
None known.
Response
200 OK
{
"messages": [
{
"api_version": "2010-04-01",
"sid": "675859e9-0f26-4083-bf68-40382a043ed9",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "92eb9d26-69e5-4e63-9a57-00421a46ab41",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "2442",
"messaging_service_sid": null,
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "accepted",
"subresource_uris": {
},
"tags": {
},
"to": "+85512334667",
"uri": "/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages/675859e9-0f26-4083-bf68-40382a043ed9"
}
],
"uri": "/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages",
"page": 0,
"page_size": 50,
"first_page_uri": "/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages?Page=0",
"previous_page_uri": "/2010-04-01/Accounts/92eb9d26-69e5-4e63-9a57-00421a46ab41/Messages?Page=0&PageToken=PB675859e9-0f26-4083-bf68-40382a043ed9",
"next_page_uri": null
}
Schedule a Message
Request
curl "https://api.somleng.org/2010-04-01/Accounts/cf1cc520-d1bc-4e90-8326-d6ce3d61cacb/Messages" -d 'To=%2B855716788123&Body=Hello+World&SendAt=2024-04-23T07%3A39%3A43Z&ScheduleType=fixed&MessagingServiceSid=dbadcf4b-fdbe-4e75-ba45-3327faee1334' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u cf1cc520-d1bc-4e90-8326-d6ce3d61cacb:LLOz0f_SyBAzLTZtNAPHBCWfmsBS3GUb70lBtVa6aBE
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages
POST https://api.somleng.org/2010-04-01/Accounts/cf1cc520-d1bc-4e90-8326-d6ce3d61cacb/Messages
Parameters
To=%2B855716788123&Body=Hello+World&SendAt=2024-04-23T07%3A39%3A43Z&ScheduleType=fixed&MessagingServiceSid=dbadcf4b-fdbe-4e75-ba45-3327faee1334
Name | Description |
---|---|
From | A phone number in E.164 format. Required if MessagingServiceSid is not passed |
MessagingServiceSid | The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery. |
Body required | The text of the message you want to send. Can be up to 1,600 characters in length. |
To required | The destination phone number in E.164 format |
StatusCallback | The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued , failed , sent , delivered , or undelivered . Somleng will POST its standard request parameters as well as some additional parameters including MessageSid , MessageStatus , and ErrorCode . URLs must contain a valid hostname (underscores are not permitted). |
StatusCallbackMethod | The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST . |
ValidityPeriod | How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. |
SmartEncoded | Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false . |
ScheduleType | Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time. |
SendAt | The time that we will send the message. Must be in ISO 8601 format. |
Response
201 Created
{
"api_version": "2010-04-01",
"sid": "3527e0a1-7245-4541-8cb0-1c592abf23d6",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "cf1cc520-d1bc-4e90-8326-d6ce3d61cacb",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": null,
"messaging_service_sid": "dbadcf4b-fdbe-4e75-ba45-3327faee1334",
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "scheduled",
"subresource_uris": {
},
"tags": {
},
"to": "+855716788123",
"uri": "/2010-04-01/Accounts/cf1cc520-d1bc-4e90-8326-d6ce3d61cacb/Messages/3527e0a1-7245-4541-8cb0-1c592abf23d6"
}
Create a Message
Request
curl "https://api.somleng.org/2010-04-01/Accounts/8c904bde-6dcb-4f93-b335-51891053e894/Messages" -d 'To=%2B855+716+788+123&From=%2B855+716+788+999&Body=Hello+World' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 8c904bde-6dcb-4f93-b335-51891053e894:QItoALgGTTky5xuTyz2s58IYyQCzANm6ceZhugYpKF0
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages
POST https://api.somleng.org/2010-04-01/Accounts/8c904bde-6dcb-4f93-b335-51891053e894/Messages
Parameters
To=%2B855+716+788+123&From=%2B855+716+788+999&Body=Hello+World
Name | Description |
---|---|
From | A phone number in E.164 format. Required if MessagingServiceSid is not passed |
MessagingServiceSid | The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery. |
Body required | The text of the message you want to send. Can be up to 1,600 characters in length. |
To required | The destination phone number in E.164 format |
StatusCallback | The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued , failed , sent , delivered , or undelivered . Somleng will POST its standard request parameters as well as some additional parameters including MessageSid , MessageStatus , and ErrorCode . URLs must contain a valid hostname (underscores are not permitted). |
StatusCallbackMethod | The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST . |
ValidityPeriod | How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. |
SmartEncoded | Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false . |
ScheduleType | Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time. |
SendAt | The time that we will send the message. Must be in ISO 8601 format. |
Response
201 Created
{
"api_version": "2010-04-01",
"sid": "37d87f2d-dc56-44a4-821f-01e5c6da1b85",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "8c904bde-6dcb-4f93-b335-51891053e894",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "+855716788999",
"messaging_service_sid": null,
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "queued",
"subresource_uris": {
},
"tags": {
},
"to": "+855716788123",
"uri": "/2010-04-01/Accounts/8c904bde-6dcb-4f93-b335-51891053e894/Messages/37d87f2d-dc56-44a4-821f-01e5c6da1b85"
}
Create a Message through a Messaging Service
Request
curl "https://api.somleng.org/2010-04-01/Accounts/c56cc6ea-4c59-47cf-a658-bae80795c818/Messages" -d 'To=%2B855716788123&MessagingServiceSid=10b0c549-f302-40d5-a7b9-3ff69dab5df7&Body=Hello+World' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u c56cc6ea-4c59-47cf-a658-bae80795c818:nGIDyegYXNU3yIRz0N3Rzyk4QGmCYhKTQVKx819F7Bs
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages
POST https://api.somleng.org/2010-04-01/Accounts/c56cc6ea-4c59-47cf-a658-bae80795c818/Messages
Parameters
To=%2B855716788123&MessagingServiceSid=10b0c549-f302-40d5-a7b9-3ff69dab5df7&Body=Hello+World
Name | Description |
---|---|
From | A phone number in E.164 format. Required if MessagingServiceSid is not passed |
MessagingServiceSid | The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery. |
Body required | The text of the message you want to send. Can be up to 1,600 characters in length. |
To required | The destination phone number in E.164 format |
StatusCallback | The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued , failed , sent , delivered , or undelivered . Somleng will POST its standard request parameters as well as some additional parameters including MessageSid , MessageStatus , and ErrorCode . URLs must contain a valid hostname (underscores are not permitted). |
StatusCallbackMethod | The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST . |
ValidityPeriod | How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. |
SmartEncoded | Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false . |
ScheduleType | Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time. |
SendAt | The time that we will send the message. Must be in ISO 8601 format. |
Response
201 Created
{
"api_version": "2010-04-01",
"sid": "b30b5765-bf10-49f2-af5a-ab246a9cda1a",
"date_created": "Thu, 18 Apr 2024 07:39:43 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:43 -0000",
"account_sid": "c56cc6ea-4c59-47cf-a658-bae80795c818",
"body": "Hello World",
"date_sent": null,
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": null,
"messaging_service_sid": "10b0c549-f302-40d5-a7b9-3ff69dab5df7",
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"status": "accepted",
"subresource_uris": {
},
"tags": {
},
"to": "+855716788123",
"uri": "/2010-04-01/Accounts/c56cc6ea-4c59-47cf-a658-bae80795c818/Messages/b30b5765-bf10-49f2-af5a-ab246a9cda1a"
}
Pagination
When fetching multiple pages of API results, use the provided next_page_uri
parameter to retrieve the next page of results.
List resources with PageSize
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?PageSize=2" -X GET \
-u bd989137-36e7-49ec-88e6-f44353b4a215:dmRwVTaJTSo0VBaWpAZr0U8dU1LDzj4g4Rg834bHojI
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls
GET https://api.somleng.org/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?PageSize=2
Parameters
PageSize: 2
Name | Description |
---|---|
PageSize | How many resources to return in each list page. The default is 50, and the maximum is 100. |
Response
200 OK
{
"calls": [
{
"api_version": "2010-04-01",
"sid": "c9ae9def-28ff-4286-a0d1-7c31a5a031b0",
"date_created": "Thu, 18 Apr 2024 07:39:44 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:44 -0000",
"account_sid": "bd989137-36e7-49ec-88e6-f44353b4a215",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "2442",
"from_formatted": "2442",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": null,
"price": null,
"price_unit": null,
"start_time": null,
"status": "queued",
"subresource_uris": {
},
"to": "+85512334667",
"to_formatted": "+855 12 334 667",
"uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls/c9ae9def-28ff-4286-a0d1-7c31a5a031b0"
},
{
"api_version": "2010-04-01",
"sid": "98b0d685-7a69-49f9-8d4f-8c18bace12e9",
"date_created": "Thu, 18 Apr 2024 07:39:44 -0000",
"date_updated": "Thu, 18 Apr 2024 07:39:44 -0000",
"account_sid": "bd989137-36e7-49ec-88e6-f44353b4a215",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "2442",
"from_formatted": "2442",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": null,
"price": null,
"price_unit": null,
"start_time": null,
"status": "queued",
"subresource_uris": {
},
"to": "+85512334667",
"to_formatted": "+855 12 334 667",
"uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls/98b0d685-7a69-49f9-8d4f-8c18bace12e9"
}
],
"uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?PageSize=2",
"page": 0,
"page_size": 2,
"first_page_uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?Page=0&PageSize=2",
"previous_page_uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?Page=0&PageSize=2&PageToken=PBc9ae9def-28ff-4286-a0d1-7c31a5a031b0",
"next_page_uri": "/2010-04-01/Accounts/bd989137-36e7-49ec-88e6-f44353b4a215/Calls?Page=1&PageSize=2&PageToken=PA98b0d685-7a69-49f9-8d4f-8c18bace12e9"
}
Verification Services
Create a Verification Service
Request
curl "https://verify.somleng.org/v2/Services" -d 'account_sid=9193e9a8-cdca-404e-9adf-bcf190967a82&FriendlyName=My+Verification+Service' -X POST \
-u 9193e9a8-cdca-404e-9adf-bcf190967a82:KDRZoH---x9qlpW_CNeEPqxf0kUBja-QW65KL-RH8vg \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services
POST https://verify.somleng.org/v2/Services
Parameters
account_sid=9193e9a8-cdca-404e-9adf-bcf190967a82&FriendlyName=My+Verification+Service
Name | Description |
---|---|
FriendlyName required | A descriptive string that you create to describe the verification service. It can be up to 32 characters long. |
CodeLength | The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. |
Response
201 Created
{
"sid": "3b9e875c-77e1-4236-9357-a473c4118b49",
"account_sid": "9193e9a8-cdca-404e-9adf-bcf190967a82",
"date_created": "2024-04-18T07:40:13Z",
"date_updated": "2024-04-18T07:40:13Z",
"friendly_name": "My Verification Service",
"url": "http://verify.lvh.me/v2/Services/3b9e875c-77e1-4236-9357-a473c4118b49",
"code_length": 6
}
Fetch a Service
Request
curl -g "https://verify.somleng.org/v2/Services/d7dcbac3-0968-466d-ad23-650a1268c0f3" -X GET \
-u b78fea3a-be5c-42d9-a910-15e49abd5ff7:9AI5IJ-re4hDqv2DHfOY1vq-Yz-ZW-SNSg3egHwVoNs
Endpoint
GET https://verify.somleng.org/v2/Services/:sid
GET https://verify.somleng.org/v2/Services/d7dcbac3-0968-466d-ad23-650a1268c0f3
Parameters
None known.
Response
200 OK
{
"sid": "d7dcbac3-0968-466d-ad23-650a1268c0f3",
"account_sid": "b78fea3a-be5c-42d9-a910-15e49abd5ff7",
"date_created": "2024-04-18T07:40:13Z",
"date_updated": "2024-04-18T07:40:13Z",
"friendly_name": "My Verification Service",
"url": "http://verify.lvh.me/v2/Services/d7dcbac3-0968-466d-ad23-650a1268c0f3",
"code_length": 4
}
Update a Service
Request
curl "https://verify.somleng.org/v2/Services/a995cdb3-3f41-4e6d-811f-335573a1e2e2" -d 'FriendlyName=Rocket+Ride+Service&CodeLength=6' -X POST \
-u 9907f8ee-54c7-416f-a26e-4080e73d439c:jEZckwJyi66RK87Oluq62H0vTZYa2k-4fae7SxdWc4w \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
POST https://verify.somleng.org/v2/Services/:sid
POST https://verify.somleng.org/v2/Services/a995cdb3-3f41-4e6d-811f-335573a1e2e2
Parameters
FriendlyName=Rocket+Ride+Service&CodeLength=6
Name | Description |
---|---|
Sid required | The SID of the Service Resource to update. |
FriendlyName required | A descriptive string that you create to describe the verification service. It can be up to 32 characters long. |
CodeLength | The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. |
Response
200 OK
{
"sid": "a995cdb3-3f41-4e6d-811f-335573a1e2e2",
"account_sid": "9907f8ee-54c7-416f-a26e-4080e73d439c",
"date_created": "2024-04-18T07:40:13Z",
"date_updated": "2024-04-18T07:40:13Z",
"friendly_name": "Rocket Ride Service",
"url": "http://verify.lvh.me/v2/Services/a995cdb3-3f41-4e6d-811f-335573a1e2e2",
"code_length": 6
}
List all Services
Request
curl -g "https://verify.somleng.org/v2/Services" -X GET \
-u 45b9e823-4555-4917-9ee4-586fdc66ec08:r4iKHIQCgI14hQNgIrazYW4w9kF5jZvBZl4xf6Yw1Ss
Endpoint
GET https://verify.somleng.org/v2/Services
GET https://verify.somleng.org/v2/Services
Parameters
None known.
Response
200 OK
{
"services": [
{
"sid": "4906332c-09ba-40c1-aa36-1364e408fcc2",
"account_sid": "45b9e823-4555-4917-9ee4-586fdc66ec08",
"date_created": "2024-04-18T07:40:13Z",
"date_updated": "2024-04-18T07:40:13Z",
"friendly_name": "My Verification Service",
"url": "http://verify.lvh.me/v2/Services/4906332c-09ba-40c1-aa36-1364e408fcc2",
"code_length": 4
}
],
"meta": {
"url": "https://verify.somleng.org/v2/Services",
"page": 0,
"page_size": 50,
"first_page_url": "https://verify.somleng.org/v2/Services?Page=0",
"previous_page_url": "https://verify.somleng.org/v2/Services?Page=0&PageToken=PB4906332c-09ba-40c1-aa36-1364e408fcc2",
"next_page_url": null,
"key": "services"
}
}
Delete a Service
Request
curl "https://verify.somleng.org/v2/Services/75618073-6100-4726-b272-01632724c6e6" -d '' -X DELETE \
-u a93961d1-2634-49df-851c-d8782e614f80:u2-dKlo6bjDJzNZaJZj5206s1d9YJqbT0tpuWjoCMl4 \
-H "Content-Type: application/x-www-form-urlencoded"
Endpoint
DELETE https://verify.somleng.org/v2/Services/:sid
DELETE https://verify.somleng.org/v2/Services/75618073-6100-4726-b272-01632724c6e6
Parameters
Name | Description |
---|---|
Sid required | The SID of the Service Resource to delete. |
Response
204 No Content
Phone Calls
Create a call
Request
curl "https://api.somleng.org/2010-04-01/Accounts/0089fa8b-408f-43ef-84f6-2c619f9e886d/Calls" -d 'To=%2B299221234&From=855972345785&Url=https%3A%2F%2Fdemo.twilio.com%2Fdocs%2Fvoice.xml' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 0089fa8b-408f-43ef-84f6-2c619f9e886d:MYxBKn5S3ZeAY7MyJwlAv7d51rBNs8D7NuuqHyCZ49A
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls
POST https://api.somleng.org/2010-04-01/Accounts/0089fa8b-408f-43ef-84f6-2c619f9e886d/Calls
Parameters
To=%2B299221234&From=855972345785&Url=https%3A%2F%2Fdemo.twilio.com%2Fdocs%2Fvoice.xml
Name | Description |
---|---|
To required | The phone number to call. |
From required | The phone number to use as the caller id |
Url | The absolute URL that returns the TwiML instructions for the call. We will call this URL using the method when the call connects. |
Method | The HTTP method we should use when calling the url parameter's value. Can be: GET or POST and the default is POST . |
Twiml | TwiML instructions for the call Somleng will use without fetching Twiml from Url parameter. If both Twiml and Url are provided then Twiml parameter will be ignored. |
StatusCallback | The URL we should call using the status_callback_method to send status information to your application. URLs must contain a valid hostname (underscores are not permitted). |
StatusCallbackMethod | The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST . |
Response
201 Created
{
"api_version": "2010-04-01",
"sid": "43ca13cf-b24f-4bbf-976c-4a7398d0df60",
"date_created": "Thu, 18 Apr 2024 07:40:13 -0000",
"date_updated": "Thu, 18 Apr 2024 07:40:13 -0000",
"account_sid": "0089fa8b-408f-43ef-84f6-2c619f9e886d",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "+855972345785",
"from_formatted": "+855 97 234 5785",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": "680305c5-cc3c-48bd-8141-a383a749d474",
"price": null,
"price_unit": null,
"start_time": null,
"status": "queued",
"subresource_uris": {
},
"to": "+299221234",
"to_formatted": "+299 22 1234",
"uri": "/2010-04-01/Accounts/0089fa8b-408f-43ef-84f6-2c619f9e886d/Calls/43ca13cf-b24f-4bbf-976c-4a7398d0df60"
}
Update a call
Request
curl "https://api.somleng.org/2010-04-01/Accounts/643211d3-b7ef-416b-9595-418eb4ef2ba4/Calls/2b87538f-4092-4185-b455-cb3cd95c9dc2" -d 'Status=completed' -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 643211d3-b7ef-416b-9595-418eb4ef2ba4:OVG-uq-OuB4T57sd1eT29B79y3jIAKMPazwfTrS0RO8
Endpoint
POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:sid
POST https://api.somleng.org/2010-04-01/Accounts/643211d3-b7ef-416b-9595-418eb4ef2ba4/Calls/2b87538f-4092-4185-b455-cb3cd95c9dc2
Parameters
Status=completed
Name | Description |
---|---|
Status | The new status of the resource. Can be: canceled or completed . Specifying canceled will attempt to hang up calls that are queued or ringing ; however, it will not affect calls already in progress. Specifying completed will attempt to hang up a call even if it's already in progress. |
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "2b87538f-4092-4185-b455-cb3cd95c9dc2",
"date_created": "Thu, 18 Apr 2024 07:40:14 -0000",
"date_updated": "Thu, 18 Apr 2024 07:40:14 -0000",
"account_sid": "643211d3-b7ef-416b-9595-418eb4ef2ba4",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "2442",
"from_formatted": "2442",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": null,
"price": null,
"price_unit": null,
"start_time": null,
"status": "in-progress",
"subresource_uris": {
},
"to": "+85512334667",
"to_formatted": "+855 12 334 667",
"uri": "/2010-04-01/Accounts/643211d3-b7ef-416b-9595-418eb4ef2ba4/Calls/2b87538f-4092-4185-b455-cb3cd95c9dc2"
}
Fetch a call
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/f68e8d0b-855f-4e5c-b65f-ea984fc24c2c/Calls/60aa9670-6349-4e4a-ac72-ec2d7e2307e3" -X GET \
-H "Content-Type: application/x-www-form-urlencoded" \
-u f68e8d0b-855f-4e5c-b65f-ea984fc24c2c:6XD1B733g_k1rNrRYQnKjxWjbghNzi_A1azMl5eznGA
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:sid
GET https://api.somleng.org/2010-04-01/Accounts/f68e8d0b-855f-4e5c-b65f-ea984fc24c2c/Calls/60aa9670-6349-4e4a-ac72-ec2d7e2307e3
Parameters
None known.
Response
200 OK
{
"api_version": "2010-04-01",
"sid": "60aa9670-6349-4e4a-ac72-ec2d7e2307e3",
"date_created": "Thu, 18 Apr 2024 07:40:14 -0000",
"date_updated": "Thu, 18 Apr 2024 07:40:14 -0000",
"account_sid": "f68e8d0b-855f-4e5c-b65f-ea984fc24c2c",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "2442",
"from_formatted": "2442",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": null,
"price": null,
"price_unit": null,
"start_time": null,
"status": "queued",
"subresource_uris": {
},
"to": "+85512334667",
"to_formatted": "+855 12 334 667",
"uri": "/2010-04-01/Accounts/f68e8d0b-855f-4e5c-b65f-ea984fc24c2c/Calls/60aa9670-6349-4e4a-ac72-ec2d7e2307e3"
}
List phone calls
Request
curl -g "https://api.somleng.org/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls" -X GET \
-H "Content-Type: application/x-www-form-urlencoded" \
-u 13ba1874-94f7-44d0-8dbe-98c1e186366c:eEqDGWa939pWKA6uh9pTYb2imY16WsiypN7x2TJyzzk
Endpoint
GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls
GET https://api.somleng.org/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls
Parameters
None known.
Response
200 OK
{
"calls": [
{
"api_version": "2010-04-01",
"sid": "8c25a45e-3a4b-4979-acde-8474b659d3f3",
"date_created": "Thu, 18 Apr 2024 07:40:14 -0000",
"date_updated": "Thu, 18 Apr 2024 07:40:14 -0000",
"account_sid": "13ba1874-94f7-44d0-8dbe-98c1e186366c",
"annotation": null,
"answered_by": null,
"caller_name": null,
"direction": "outbound-api",
"duration": null,
"end_time": null,
"forwarded_from": null,
"from": "2442",
"from_formatted": "2442",
"group_sid": null,
"parent_call_sid": null,
"phone_number_sid": null,
"price": null,
"price_unit": null,
"start_time": null,
"status": "queued",
"subresource_uris": {
},
"to": "+85512334667",
"to_formatted": "+855 12 334 667",
"uri": "/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls/8c25a45e-3a4b-4979-acde-8474b659d3f3"
}
],
"uri": "/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls",
"page": 0,
"page_size": 50,
"first_page_uri": "/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls?Page=0",
"previous_page_uri": "/2010-04-01/Accounts/13ba1874-94f7-44d0-8dbe-98c1e186366c/Calls?Page=0&PageToken=PB8c25a45e-3a4b-4979-acde-8474b659d3f3",
"next_page_uri": null
}