Semiocast API Documentation
Prepare annotations

About

Prepare semantic information which may be included when posting. This information may be added into the message as metadata or annotations according to targeted social network. See Micromessage analysis for a full list of returned information.

Prepare annotations is currently only available for Twitter and returns annotations compatible with statuses/update call.

URL

https://api.semiocast.com/1/prepare/twitter.format

Formats

Output in JSON

Rate limit

1 call per request (read API levels for more information).

Input

ParameterMandatoryTypeDescription
statusYes string Posted text.
locationNo string User location when posting.

HTTP Status codes

Read Errors for general information about error messages and interpretation of returned HTTP status codes.

Output

In case of success, metadata or annotations to be sent when posting.

Examples

Twitter allows user to add annotations when posting a message. Annotations returned by Semiocast API is compatible with Twitter annotations format. Before posting a message on Twitter, post it to Semiocast API and associate returned result to the annotations parameter.

curl -E semiocast-api.pem:PASSWORD -d status='Post with annotation' -d location='Paris' "https://api.semiocast.com/1/prepare/twitter.json"

This returns a prepared annotation that should look similar to:

[{"language":{"provider":"http://semiocast.com/", "script_code":"latn", "language_code":"en"}}, {"location":{"provider":"http://semiocast.com/", "country_code":"FR", "city_name":"Paris"}}]

Then you can use this prepared annotation to post on Twitter:

curl -u TWITTER_USERNAME:TWITTER_PASSWORD -d status='Post with annotation' -d annotations='[{"language":{"provider":"http://semiocast.com/", "script_code":"latn", "language_code":"en"}}, {"location":{"provider":"http://semiocast.com/", "country_code":"fr", "city_name":"Paris"}}]' "https://api.twitter.com/1/statuses/update.json"