09. Query interface
GET /inbox/{page}.{format}
Query incoming messages
curl 'http://api.linkmobility.dk/v2/inbox/{page}.json?apikey=[apikey]' -X GET curl 'http://api.linkmobility.dk/v2/inbox/{page}.xml?apikey=[apikey]' -X GET
Fields
You can use the following GET parameter when searching for messages
yName | Type | Description |
---|---|---|
recipient | string | Search for messages with specific recipient |
sender | String | Search for messages with a specific sender |
starttime | Date dd-mm-YYYY HH:MM | Search time interval start |
endtime | Date dd-mm-YYYY HH:MM | Search time interval end |
msgid | String | Search for messages with msgid |
message | String | Wildcard search in text |
keyword | String | Search for message to specific keyword. |
response
{ "query": [ { "lookupid": "1424185035-66417", "msgid": "4ab1a952e2645f4d39e06e26c9c220d6", "recipient": "+45609940305097", "sender": "4512345678", "logtime": "17-02-2015 15:57:15", "message": "Hmn" } ], "paging": { "pages": 1, "offset": 10, "current": 1 }, "stats": { "total": 1 }, "status": 200 }
GET /inbox/lookup/{lookupid}.{format}
Get details for a single incomming message
curl 'http://api.linkmobility.dk/v2/inbox/lookup/{lookupid}.json?apikey=[apikey]' -X GET curl 'http://api.linkmobility.dk/v2/inbox/lookup/{lookupid}.xml?apikey=[apikey]' -X GET
response
{ "query": { "msgid": "4ab1a952e2645f4d39e06e26c9c220d6", "recipient": "+45609940305097", "sender": "4512345678", "logtime": "17-02-2015 15:57:15", "message": "Hmn", "keyword": "HMN", "function": "liste" }, "status": 200 }
GET /outbox/{page}.{format}
Query outgoing messages
curl 'http://api.linkmobility.dk/v2/outbox/{page}.json?apikey=[apikey]' -X GET curl 'http://api.linkmobility.dk/v2/outbox/{page}.xml?apikey=[apikey]' -X GET
Fields
You can use the following GET parameter when searching for messages
Name | Type | Description |
---|---|---|
recipient | string | Search for messages with specific recipient |
sender | String | Search for messages with a specific sender |
starttime | Date dd-mm-YYYY HH:MM | Search time interval start |
endtime | Date dd-mm-YYYY HH:MM | Search time interval end |
price | Integer | Search for messages that has price |
price_expression | Enum (<, >, = ) | How to search for price |
batchid | Integer | Search for messages with batchid |
msgid | String | Search for messages with msgid |
message | String | Wildcard search in text |
status | String | Search for messages with specific status |
mcc | String | Either a single [http://en.wikipedia.org/wiki/Mobile_country_code] or a comma seperated list |
subusers | Integer | If set to 1, then the query will extend to also include messages sent from a subuser |
response
{ "query": [ { "lookupid": "1424185035-66418", "msgid": "852e453d32e8459af090a3019fa9f9f6", "batchid": "659177", "status": "received", "statusreason": null, "recipient": "4512345678", "sender": "TEST", "logtime": "2015-02-13 10:32:44", "protocol": "REST", "message": "Hello world!", "statuscode": "0", "mcc": "238", "mnc":"2", "userid":"1234", "splitcount": "1", "push_price":500, "contenttype": "9", "state": "transaction-refunded" }, { "lookupid": "1424185035-66419", "msgid": "cb95abc5027ff19a907662c614f4f475", "batchid": "673449", "status": "received", "statusreason": null, "recipient": "4512345678", "sender": "TEST", "logtime": "2015-02-13 14:35:29", "protocol": "REST", "message": "æøå", "statuscode": "0", "mcc": "238", "mnc":"2", "userid":"1234", "splitcount": "1", "contenttype": "15", "state": "transaction-refunded" }, { "lookupid": "1424185035-66420", "msgid": "4ca01538b55c2ee68e531eb04773966a", "batchid": "679733", "status": "received", "statusreason": null, "recipient": "4512345678", "sender": "TEST", "logtime": "2015-02-13 15:43:45", "protocol": "REST", "message": "æøå", "statuscode": "0", "mcc": "238", "mnc":"2", "userid":"1234", "splitcount": "1" } ], "paging": { "pages": 1, "offset": 10, }, "stats": { "total": 3, "splitcount":3 }, "status": 200 }
GET /outbox/lookup/{lookupid}.{format}
Get details for a single message
curl 'http://api.linkmobility.dk/v2/outbox/lookup/{lookupid}.json?apikey=[apikey]' -X GET curl 'http://api.linkmobility.dk/v2/outbox/lookup/{lookupid}.xml?apikey=[apikey]' -X GET
response
{ "query": { "msgid": "7076fc592b59097b3c48c1f6e3321b6d", "batchid": "308605", "status": "received", "statusreason": "", "recipient": "4512345678", "sender": "Test", "logtime": "2014-12-15 09:03:47", "protocol": "REST", "message": "Hello world", "returndata": "", "statusurl": "", "statusresponse": "", "statuscode":"0", "push_price":"0", "userid":"1234", "splitcount":"1", "state":"" }, "status": 200 }
NB: If the message is a premium message, then "state" will be set to one of the following;
State |
---|
authorize-forwarded |
authorize-rejected |
capture-failed |
capture-forwarded |
capture-rejected |
refund-failed |
sms-forwarded |
sms-received |
sms-rejected |
transaction-authorized |
transaction-captured |
transaction-failed |
transaction-forwarded |
transaction-refunded |
transaction-rejected |
Feeling lost? Click on this link! Portal page