logs/v2

RESTful style

Get message logs. This is also the report format for /send/v1 reports and incoming messages.

Changes from /logs/v1

New fields text and html contain full message contents.

to and from are available as structs (the old to_address, to_name etc also still available, but may be removed in later versions)

Getting Started

To see an example of the actual data you get, follow these steps:

1. Send a message with tellustalk, either from user email or via /send/v1.

2. Visit https://api.tellustalk.com/logs/v1 with your browser. Log in with your API user id/password. 

    (This is just to get the authentication screen for domain api.tellustalk.com)

3. Visit any of these links to see a message in preferred format, for example

    https://api.tellustalk.com/logs/v2.xml?limit=1

    https://api.tellustalk.com/logs/v2.json?limit=1

These links work in your browser. When querying from your system, DO NOT use the .xml/.json endings, use the usual Accept header to specify format!

Request

Host URL: https://api.tellustalk.com/logs/v2

Method supported: GET

Request Headers:

Accept: application/json (recommended) or application/xml or text/html

Authorization: Basic username:password  (base64-encoded)

Request Parameters:

Common request parameters, used as search filters (similar to SQL 'WHERE' clause), and their description are given below:

Examples: see below.

Response

Response Headers:

Content-Type: application/json or application/xml

Link:  <https://api.tellustalk.com/logs/v1/?cursor=abc12300ETC>; rel="next"; title="UTF-8'uk'Next"     (Related Links) 

X-Total-Count: nn   (total number of records returned)

Response Data:

A list of logged messages.

Examples (abridged):

 Request Header

 Accept: application/json

 Accept: application/xml

 Retrieved Results [{"id": "1000000123", "address": "sms:+46704000000", "name": "", "status": "success"},   {"id": "1000000456", "address": "sms:+46704000000", "name": "", "status": "blocked"}] <root><item><address>sms:+46704000000</address><name /><status>success</status></item><item><address>sms:+46704000000</address><name /><status>blocked</status></item></root>

All Fields of a Logged Message

All these values are present in each log entry, but many are empty

Tips & Tricks

When developing for Incoming messages, or Log requests, you can view in your browser the data that will be sent.

Just open the Request URL but add .xml or .json to view the logs in that format.

First log in by going to https://api.tellustalk.com/logs/v2.htm and use your normal TellusTalk login.

Then replace .htm with the format you want to view, eg

https://api.tellustalk.com/logs/v2.json?limit=1

https://api.tellustalk.com/logs/v2.xml?article_id=SMS_Sent&limit=1

etc

Examples

Several of the message fields above can be used as request params, to search for specific kinds of traffic.

article_id=SMS_Reply

status=success  -- successful messages only

status=failed  -- failed messages only

conversation_id=123, job_id=123

id=123  -- to get a specific message (eg if you got empty status on a SMS_Sent, this is awaiting report

number_id=box.123abc  -- your sendlist id

number_id=44100200300  -- your incoming Fax or SMS number

to_address=467301020304 -- a specific recipient

from_address=yourserver@mail.se

user_id=abc@se.se  -- a specific user if your organisation has several users (and you have access rights to their traffic)

Any combination is valid, although many combinations return empty result.

NOTE: You get nothing from a list of values, eg

   { "article_id": ["SMS_Sent", "SMS_Reply"] }

is always empty,

but eg,

   { "article_id": "SMS_Reply", "job_id": "123" }

will return any replies to a send job.