SMS Genie API
Warning
For testing api points you need authentication in your account
Authorization Token
You can find your Authorization Token in your Account profile
> Settings
> Api Token
. Please use Api key
data.
gateway
list
You can find your gateway id in your Account profile
> Settings
> Gateways
. Please use column id
.
incoming-sms
list
Get all of the incoming SMS.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
page | A page number within the paginated result set. |
page_size | Number of results to return per page. |
id | |
uuid | |
received | DateTime format yyyy.mm.dd --:--:--.xxxxxx (look for ISO_8601 representation) |
to_number | Phone number in international format. |
from_number | DateTime format yyyy.mm.dd --:--:--.xxxxxx (look for ISO_8601 representation) |
to_user | A unique integer value identifying User. |
ordering | Which field to use when ordering the results. Choices ascending are: received. Choices descending are: -received |
$ curl 'https://www.smsgenie.co/api/v1/sms/incoming-sms/?page=2&page_size=1&ordering=received' \
-X GET \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 200
{
"count": 24,
"per_page": 1,
"previous": 1,
"results": [
{
"id": 545823,
"uuid": "110de129-e694-4675-8cf7-1ff8a00fedfa",
"content": "Test",
"received": "2017-01-12T07:24:48.301346Z",
"to_number": "+123456789010",
"gateway": null,
"from_number": "+0987654321",
"to_user": {
"id": 369412,
"first_name": "Jac",
"last_name": "Sparrow",
"e_mail": "jac@example.com",
"joined": "2016-12-28T17:28:47.771287Z",
"phone_number": "+123456789010",
"country": {
"id": 248,
"region_code": "AI",
"country_code": 1,
"is_banned": false
},
"is_staff": false,
"is_active": true,
"billing_status": "idle"
}
}
],
"next": 3
}
read
Get information about an incoming SMS.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required | A unique integer value identifying this Incoming SMS. |
$ curl 'https://www.smsgenie.co/api/v1/sms/incoming-sms/545823/' \
-X GET \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 200
{
"id": 545823,
"uuid": "110de129-e694-4675-8cf7-1ff8a00fedfa",
"content": "Test",
"received": "2017-01-12T07:24:48.301346Z",
"to_number": "+123456789010",
"gateway": null,
"from_number": "+0987654321",
"to_user": {
"id": 369412,
"first_name": "Jac",
"last_name": "Sparrow",
"e_mail": "jac@example.com",
"joined": "2016-12-28T17:28:47.771287Z",
"phone_number": "+123456789010",
"country": {
"id": 248,
"region_code": "AI",
"country_code": 1,
"is_banned": false
},
"is_staff": false,
"is_active": true,
"billing_status": "idle"
}
}
delete
Delete an incoming SMS.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required | A unique integer value identifying this Incoming SMS. |
$ curl 'https://www.smsgenie.co/api/v1/sms/incoming-sms/545823/' \
-X DELETE \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 204
outgoing-sms
list
Get all of the outgoing SMS.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
page | A page number within the paginated result set. |
page_size | Number of results to return per page. |
id | |
uuid | |
to_number | Phone number in international format. |
from_number | Phone number in international format. |
name | Name for the sms |
gateway | A unique integer value identifying this Gateway. |
from_user | A unique integer value identifying User. |
relayed | DateTime format yyyy.mm.dd --:--:--.xxxxxx (look for ISO_8601 representation) |
sent | DateTime format yyyy.mm.dd --:--:--.xxxxxx (look for ISO_8601 representation) |
created | DateTime format yyyy.mm.dd --:--:--.xxxxxx (look for ISO_8601 representation) |
ordering | Which field to use when ordering the results. Choices ascending are: relayed, sent, created. Choices descending are: -relayed, -sent, -created |
$ curl 'https://www.smsgenie.co/api/v1/sms/outgoing-sms/?page=10&page_size=1&ordering=-created' \
-X GET \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 200
{
"count": 71,
"per_page": 1,
"previous": 9,
"results": [
{
"id": 16368,
"uuid": "a2fa6244-59fe-4d07-ac4f-24652706cec7",
"to_number": "+123456789010",
"from_number": "+123456789011",
"content": "Test message",
"name": "",
"gateway": null,
"from_user": {
"id": 369412,
"first_name": "Jac",
"last_name": "Sparrow",
"e_mail": "jac@example.com",
"joined": "2016-12-28T17:28:47.771287Z",
"phone_number": "+123456789010",
"country": {
"id": 248,
"region_code": "AI",
"country_code": 1,
"is_banned": false
},
"is_staff": false,
"is_active": true,
"billing_status": "idle"
}
"status": "delivered",
"received": "2017-02-01T23:49:59.783000Z",
"delivered": "2017-02-01T23:50:52.388000Z",
"failed": null,
"relayed": "2017-02-01T23:49:59.185748Z",
"sent": "2017-02-01T23:50:08.036000Z",
"created": "2017-02-01T23:49:54.008599Z",
"message": "Test",
"signature": null,
"fail_reason": null
}
],
"next": 11
}
create
Create an new outgoing SMS.
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
to_number required | Phone number in international format. |
name | Name for the sms |
gateway required | A unique integer value identifying this Gateway. |
message required | Message Body |
signature | A unique integer value identifying this Signature. |
$ curl 'https://www.smsgenie.co/api/v1/sms/outgoing-sms/' \
-X POST \
--data '{"to_number": "+123456789010", "gateway": "402", "message": "Test message"}' \
--header 'Content-type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 201
{
"id": 335972,
"uuid": "32e098c6-1fbb-451f-b239-4fee25f2fc5c",
"to_number": "+123456789010",
"from_number": null,
"content": "Test message",
"name": "",
"gateway": 402,
"from_user": 19501,
"status": "created",
"received": null,
"delivered": null,
"failed": null,
"relayed": null,
"sent": null,
"created": "2017-06-29T11:47:58.028382Z",
"message": "Test message",
"signature": null,
"fail_reason": null
}
check
Pre-validate fields for outgoing SMS.
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
to_number | Phone number in international format. |
name | Name for the sms |
gateway | A unique integer value identifying this Gateway. |
message | Message Body |
signature | A unique integer value identifying this Signature. |
$ curl 'https://www.smsgenie.co/api/v1/sms/outgoing-sms/check/' \
-X POST \
--data '{"to_number": "+447700900955"}' \
--header 'Content-type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 200
read
Get information about an outgoing SMS.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required | A unique integer value identifying this Outgoing SMS. |
$ curl 'https://www.smsgenie.co/api/v1/sms/outgoing-sms/16368/' \
-X GET \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 200
{
"id": 16368,
"uuid": "a2fa6244-59fe-4d07-ac4f-24652706cec7",
"to_number": "+123456789011",
"from_number": "+123456789010",
"content": "Test message",
"name": "",
"gateway": null,
"from_user": {
"id": 369412,
"first_name": "Jac",
"last_name": "Sparrow",
"e_mail": "jac@example.com",
"joined": "2016-12-28T17:28:47.771287Z",
"phone_number": "+123456789010",
"country": {
"id": 248,
"region_code": "AI",
"country_code": 1,
"is_banned": false
},
"is_staff": true,
"is_active": true,
"billing_status": "idle"
},
"status": "delivered",
"received": "2017-02-01T23:49:59.783000Z",
"delivered": "2017-02-01T23:50:52.388000Z",
"failed": null,
"relayed": "2017-02-01T23:49:59.185748Z",
"sent": "2017-02-01T23:50:08.036000Z",
"created": "2017-02-01T23:49:54.008599Z",
"message": "1321321",
"signature": null,
"fail_reason": null
}
delete
Delete an outgoing SMS.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required | A unique integer value identifying this Outgoing SMS. |
$ curl 'https://www.smsgenie.co/api/v1/sms/outgoing-sms/16368/' \
-X DELETE \
--header 'Accept: application/json' \
--header 'Authorization: Token your-token-key'
Response 204