Skip to main content

Overview

URL Scheme
https://api.theca.com/v1/

Query parameters

Parameters to requests are sent as query parameters. These are described for each request in the following pages. Some parameters are optional, which is denoted with a question mark in the type column. See the following example.

ParameterTypeDescription
exampleTextThis parameter is a mandatory string.
optionalInteger?This parameter is an optional integer.

Header parameters

Header parameters must be attached to each API request (though some requests are open for end-users). API requests to closed requests without a Theca-Client-Token will be rejected with a 403 Forbidden HTTP status.

caution

Do not prefix the headers with X- (this is a deprecated custom for custom HTTP header parameters).


ParameterTypeDescription
Theca-Client-TokenTextA long string that uniquely identifies each client. Provided by Theca.

Note that tokens may be revoked by Theca, e.g., if they are compromised or if a token generating service is implemented in a future version of the API.
Theca-User-TokenText?Provided by clients to identify users through system requests. Requests using the same session token will belong to the same session. The provided token will be one-way encrypted (i.e., hashed). Though, it is still not recommended to use sensitive user data for this parameter, such as e-mails or usernames. Internal user IDs or session tokens are both recommended. The maximum size is 255 bytes, the remainder will be discarded.

This parameter is optional and is used for improving the search results.

Formats

Search result data can be returned in either application/json or application/ld+json format. The client chooses which format to use with the HTTP Accept header parameter.

Supported formats:

Accept valueDescription
application/jsonThe data will be formed in JSON standard. This is the default if no Accept parameter is provided or if / is used.
application/ld+jsonReturned data follows the LD-JSON RDF format from https://schema.org/. The structure is equivalent to application/json but the @type of complex objects are included which might make development easier. The data returned can be validated at https://validator.schema.org/.

Note that properties with the enum type will have values prefixed with https://schema.org/ as per the specification. For example, when using LD-JSON the item availability property of in stock will be just "availability": "InStock" for application/json but will be "availability": https://schema.org/InStock for LD-JSON.