Welcome to TicketsCloud’s documentation!

Contents:

TicketsCloud HTTP API v1-beta

API Basics

In this chapter you’ll find HTTP API common bits about design and workflow.

HTTP Basics

TicketsCloud API is based on HTTP, so it would be good for you to know it basics at the first place. We wouldn’t copy-paste whole RFC 2616 and it recent updates there. Instead, we strongly RECOMMEND you to ackowledge with them. Above we’ll describe only parts of HTTP specification which TicketsCloud API is widely uses.

Request Methods

TicketsCloud uses the following HTTP request methods:

  • GET

    Request the specified item.

  • HEAD

    This method works like GET except that request with it doesn’t returns payload content.

  • POST

    Create a new object or makes some action that doesn’t creates a new resource.

  • PUT

    Used to update a specified resource or create a new one on the specified resource.

  • DELETE

    Deletes the specified resource, destroys associated object or cancels some action.

  • PATCH

    While PUT is used to update whole resource content, PATCH allows to update only certain fields without need to pass around all the data.

Request Headers
  • Accept

    Specifies the list of accepted data types to be returned by the server (i.e. that are accepted/understandable by the client). The format should be a list of one or more MIME types, separated by colons.

    For the majority of requests the definition should be for JSON data (application/json).

    The use of Accept in requests is not required, but is highly recommended as it helps to ensure that the data returned can be processed by the client.

    If resource is unable to return the response in the accepted MIME type, the 406 Not Acceptable response will be returned instead.

  • Authorization

    Specified authentication token by which the server can recognize the related user.

    TicketsCloud API uses custom authentication scheme named Key and custom unique token which users receives from TicketsCloud customers service.

    GET /v1/resources/events HTTP/1.1
    Accept: application/json
    Authorization: Key 6e6124cfc954496a850aa959ef2f64fa
    Host: ticketscloud.org
    
  • Content-Type

    Specifies the content type of the information being supplied within the request. The specification uses MIME type specifications. For the majority of requests this will be JSON (application/json).

    The use of the Content-Type on a request is highly recommended.

Response Status Codes

With the interface to TicketsCloud working through HTTP, error codes and statuses are reported using a combination of the HTTP status code number, and corresponding data in the body of the response data.

A list of the error codes returned by TicketsCloud, and generic descriptions of the related errors are provided below. The meaning of different status codes for specific request types are provided in the corresponding API call reference.

  • 200 OK

    Request completed successfully.

  • 201 Created

    Resource object had been created successfully.

  • 202 Accepted

    Request has been accepted, but the corresponding operation may not have completed. This is used for background operations, such as database compaction.

  • 400 Bad Request

    Bad request structure. The error can indicate an error with the request URL, path, headers or payload data.

  • 401 Unauthorized

    The item requested was not available using the supplied authorization, or authorization was not supplied.

  • 403 Forbidden

    The requested item or operation is forbidden.

  • 404 Not Found

    The requested content could not be found. The content will include further information, as a JSON object, if available.

  • 405 Method Not Allowed

    A request was made using an invalid HTTP request type for the URL requested. For example, you have requested a PUT when a POST is required. Errors of this type can also triggered by invalid URL strings.

  • 406 Not Acceptable

    The requested content type is not supported by the server.

  • 409 Conflict

    Request resulted in an update conflict.

  • 415 Unsupported Media Type

    The content types supported, and the content type of the information being requested or submitted indicate that the content type is not supported.

  • 500 Internal Server Error

    The request was invalid, either because the supplied JSON was invalid, or invalid information was supplied as part of the request.

  • 502 Bad Gateway

    Something really gone wrong.

Response Headers

Response headers are returned by the server when sending back content and include a number of different header fields, many of which are standard HTTP response header and have no significance to TicketsCloud operation. The list of response headers important to TicketsCloud are listed below.

  • Content-Length

    The length (in bytes) of the returned content.

  • Content-Type

    Specifies the MIME type of the returned data. For most request, the returned MIME type is text/plain. All text is encoded in Unicode (UTF-8), and this is explicitly stated in the returned Content-Type, as text/plain;charset=utf-8.

  • Cache-Control

    The cache control HTTP response header provides a suggestion for client caching mechanisms on how to treat the returned information. TicketsCloud typically returns the must-revalidate, which indicates that the information should be revalidated if possible. This is used to ensure that the dynamic nature of the content is correctly updated.

Versioning

TicketsCloud HTTP API is versioned by using URL approach: the version is explicitly defined as path segment in the format v<num>. Version numeration is stated from 1 and grows one by one.

Within the same version we guarantee that everything will works as it was before.

In case of breaking changes in API, version number gets bumped.

JSON

The majority of requests and responses to TicketsCloud API uses the JavaScript Object Notation (JSON) for formatting the content and structure of the data and responses.

JSON is used because it is the simplest and easiest to use solution for working with data within a web browser, as JSON structures can be evaluated and used as JavaScript objects within the web browser environment.

JSON supports the same basic types as supported by JavaScript, these are:

  • Number (either integer or floating-point).
  • String; this should be enclosed by double-quotes and supports Unicode characters and backslash escaping. For example:
"A String"
  • Boolean - a true or false value. You can use these strings directly. For example:
true
  • Array - a list of values enclosed in square brackets. For example:
["one", "two", "three"]
  • Object - a set of key/value pairs (i.e. an associative array, or hash). The key must be a string, but the value can be any of the supported JSON values.

Parsing JSON into a JavaScript object is supported through the JSON.parse() function in JavaScript, or through various libraries that will perform the parsing of the content into a JavaScript object for you. Libraries for parsing and generating JSON are available in many languages, including Perl, Python, Ruby, Erlang and others.

Fields Schema DSL

When we made a request to some resource, in most cases we don’t want all the data, just a small part of it. We receiving JSON object, picking the fields we’re interested in leaving every else for garbage collector.

TicketsCloud API provides a feature to receive only those fields you’re using special query parameter fields-schema. It accepts the special DSL value which uses as field filter on server side, returning an object with only specified fields.

For example, we need to receive our current user ID and email fields only:

Request:

GET /v1/services/whoami?fields-schema=id,email HTTP/1.1
Accept: application/json
Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=ticketscloud.org; Path=/
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Server: nginx
Transfer-Encoding: chunked

{
    "id": "53da11a537abbd06b21cb254",
    "email": "user@domain.tld"
}

You may freely specify any top level fields separated by comma as fields-schema value. In case if the value is incorrect, a 400 Bad Request response will be returned.

How To Start

Simple integration

Примечание

If you’re developer jump to Get Your Widget.

Register on TicketsCloud

First of all, you should register yourself on https://ticketscloud.org

_images/integration-simple-0.png
Provide Base Information About Your Company

On the next step you need to provide base information about your company to let us know a little bit more about with whom we’re working on. This information is used to make assignments between your company and TicketsCloud.

_images/integration-simple-1.png
Create New Distributor

Next step would be creation of own distributor.

_images/integration-simple-2.png
Make a Deals

Now it’s time to make a deals! Deals are special business object which allows Distributor to sell tickets on events provided by Organizers.

_images/integration-simple-3.png
Get Your Widget

Navigate to “Options” menu, pick the widget code and insert it into your website source code. Make sure you followed other instructions on the page.

_images/integration-simple-4.png
Bind Your Events With TicketsCloud

To let your widget work, you should pass Event ID to it as query parameter. However, this ID should be native for TicketCloud and unlikely will be familiar for your system. To fix this moment you should create binding mapping between your event IDs and TicketsCloud ones. To simplify the process see Simple service for lazy integration page.

Resources

Resources operates directly with the data: collections and their elements. Each tried to follow CRUD design whenever it’s possible or reasonable.

API Keys

API Key

API Key is an unique token which uses for Partner authentication. This key should be specified as value for Authorization on each request that been made to TicketsCloud API.

GET /v1/resources/partners/{idpartner}/api_keys/{idkey}

Returns an information about API key.

Request Headers:
 
Parameters:
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – API key creation timestamp
  • id (string) – API Key ID
  • key (string) – API key itself
  • name (string) – API key name
  • partner (string) – Related Partner ID
  • removed (boolean) – Removed flag
Status Codes:

Request:

GET /v1/resources/partners/535fb19bdca6a9d1638f2007/api_keys/53f1d89437abbd0a9ca87882 HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-08-18T10:42:28.288000+00:00",
    "id": "53f1d89437abbd0a9ca87882",
    "key": "48de25a3c7f84996bc3c183c640f9948",
    "name": "new-key",
    "partner": "535fb19bdca6a9d1638f2007",
    "removed": false
}
PATCH /v1/resources/partners/{idpartner}/api_keys/{idkey}

Updates API key information.

Request Headers:
 
Parameters:
Query Parameters:
 
Request JSON Object:
 
  • name (string) – API key name
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – API key creation timestamp
  • id (string) – API Key ID
  • key (string) – API key itself
  • name (string) – API key name
  • partner (string) – Related Partner ID
  • removed (boolean) – Removed flag
Status Codes:

Request:

PATCH /v1/resources/partners/535fb19bdca6a9d1638f2007/api_keys/53f1d89437abbd0a9ca87882 HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Content-Length: 21
Content-Type: application/json; charset=utf-8
Host: ticketscloud.org

{
    "name": "new-name"
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-08-18T10:42:28.288000+00:00",
    "id": "53f1d89437abbd0a9ca87882",
    "key": "48de25a3c7f84996bc3c183c640f9948",
    "name": "new-name",
    "partner": "535fb19bdca6a9d1638f2007",
    "removed": false
}
DELETE /v1/resources/partners/{idparner}/api_keys/{idkey}

Removes an API key.

Request Headers:
 
Parameters:
Response Headers:
 
Status Codes:

Request:

DELETE /v1/resources/partners/535fb19bdca6a9d1638f2007/api_keys/53f1d89437abbd0a9ca87882 HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{}
API Keys

Manages API Key collection of specific Partner.

GET /v1/resources/partners/{idpartner}/api_keys

Returns list of API keys which Partner has.

Request Headers:
 
Parameters:
  • idpartner (string) – Partner ID
Query Parameters:
 
  • ids (string) – List of IDs to return
  • fields-schema (string) – Fields Schema DSL
Response Headers:
 
Response JSON Array of Objects:
 
  • created_at (datetime) – API key creation timestamp
  • id (string) – API Key ID
  • key (string) – API key itself
  • name (string) – API key name
  • partner (string) – Related Partner ID
  • removed (boolean) – Removed flag
Status Codes:

Request:

GET /v1/resources/partners/535fb19bdca6a9d1638f2007/api_keys HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "created_at": "2014-08-18T10:30:02.516000+00:00",
        "id": "53f1d5aa37abbd0a9da87882",
        "key": "my-very-secret-key",
        "name": "test",
        "partner": "535fb19bdca6a9d1638f2007",
        "removed": false
    },
    {
        "created_at": "2014-08-18T10:30:23.487000+00:00",
        "id": "53f1d5bf37abbd0a9ea87882",
        "key": "5a1428de2cd84b5189453470dffa3b5d",
        "name": "default",
        "partner": "535fb19bdca6a9d1638f2007",
        "removed": false
    },
    {
        "created_at": "2014-08-18T10:31:01.930000+00:00",
        "id": "53f1d5e537abbd0a9da87883",
        "key": "aaef4478264a4be2b2c9838efa8df7c6",
        "name": "crm",
        "partner": "535fb19bdca6a9d1638f2007",
        "removed": false
    }
]
POST /v1/resources/partners/{idpartner}/api_keys

Creates a new API Key.

Request Headers:
 
Parameters:
  • idpartner (string) – Partner ID
Query Parameters:
 
Request JSON Object:
 
  • name (string) – API key name
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – API key creation timestamp
  • id (string) – API Key ID
  • key (string) – API key itself
  • name (string) – API key name
  • partner (string) – Related Partner ID
  • removed (boolean) – Removed flag
Status Codes:

Request:

POST /v1/resources/partners/535fb19bdca6a9d1638f2007/api_keys HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Content-Length: 20
Content-Type: application/json; charset=utf-8
Host: ticketscloud.org

{
    "name": "new-key"
}

Response:

HTTP/1.1 201 Created
Content-Length: 203
Content-Type: application/json; charset=UTF-8

{
    "created_at": "2014-08-18T10:42:28.288420+00:00",
    "id": "53f1d89437abbd0a9ca87882",
    "key": "48de25a3c7f84996bc3c183c640f9948",
    "name": "new-key",
    "partner": "535fb19bdca6a9d1638f2007",
    "removed": false
}

Deals

Deals are required to start ticket sales on specific Event since they are defines the final price for them depending on various conditions.

Deal
GET /v1/resources/deals/{iddeal}
Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
  • partner (string) – filter for obj or subj
  • status (string) – filter for status
  • fields-schema (string) – Fields Schema DSL
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – Deal creation timestamp
  • event (string) – Event ID
  • id (string) – Deal ID
  • message (string) – Short message with deal
  • obj (string) – Partner ID
  • reversed_deal (boolean) – Deal made from subj to obj
  • status (string) – Deal status
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
  • title (object) – Title and description
  • updated_at (datetime) – Deal update timestamp
Status Codes:
PATCH /v1/resources/deals/{iddeal}

Updates a Deal.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Request JSON Object:
 
  • reversed_deal (boolean) – Make deal reversed
  • status (string) – New deal status
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – Deal creation timestamp
  • event (string) – Event ID
  • id (string) – Deal ID
  • message (string) – Short message with deal
  • obj (string) – Partner ID
  • reversed_deal (boolean) – Deal made from subj to obj
  • status (string) – Deal status
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
  • title (object) – Title and description
  • updated_at (datetime) – Deal update timestamp
Status Codes:
Deals
GET /v1/resources/deals
Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Response Headers:
 
Response JSON Array of Objects:
 
  • created_at (datetime) – Deal creation timestamp
  • event (string) – Event ID
  • id (string) – Deal ID
  • message (string) – Short message with deal
  • obj (string) – Partner ID
  • reversed_deal (boolean) – Deal made from subj to obj
  • status (string) – Deal status
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
  • title (object) – Title and description
  • updated_at (datetime) – Deal update timestamp
Status Codes:
GET /v1/resources/deals HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "created_at": null,
        "event": "5357baaff51600525c9e1397",
        "id": "535fb1f1dca6a9d1638f2008",
        "obj": "5357b929f51600525c9e1396",
        "reversed_deal": null,
        "status": "accepted",
        "subj": "535fb19bdca6a9d1638f2007",
        "term": {
            "core": "3.00%",
            "extra": "10.0%",
            "org": "91.00%",
            "pfc": false
        },
        "updated_at": null
    }
]
POST /v1/resources/deals

Creates a new Deal.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Request JSON Object:
 
  • event (string) – Event ID
  • message (string) – Short message with deal
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
Response Headers:
 
Response JSON Array of Objects:
 
  • created_at (datetime) – Deal creation timestamp
Response JSON Object:
 
  • event (string) – Event ID
  • id (string) – Deal ID
  • message (string) – Short message with deal
  • obj (string) – Partner ID
  • reversed_deal (boolean) – Deal made from subj to obj
  • status (string) – Deal status
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
  • title (object) – Title and description
  • updated_at (datetime) – Deal update timestamp
Status Codes:
POST /v1/resources/deals HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Content-Length: 118
Content-Type: application/json; charset=utf-8
Host: ticketscloud.org

{
    "event": "5368b3d49583cb96a0357590",
    "subj": "5357b929f51600525c9e1396",
    "term": {
        "extra": 10,
        "org": 10,
        "pfc": true
    }
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-08-18 16:42:29.534470+00:00",
    "event": "5368b3d49583cb96a0357590",
    "id": "545fb1f1dca6a9d1638f3192",
    "obj": "53f1f4a9e0ce77186cf52d1f",
    "reversed_deal": null,
    "status": "accepted",
    "subj": "5357b929f51600525c9e1396",
    "term": {
        "core": "10.00%",
        "extra": "10.0%",
        "org": "10.00%",
        "pfc": true
    },
    "updated_at": "2014-08-18 16:42:29.534470+00:00"
}
Deal Terms

Deal terms is an immutable object which stored within the Deal object with the following fields:

  • org (string): Amount of price which organizer will get

  • extra (string): Extra price set by agent

  • core (string): TicketsCloud commission

  • pfc (boolean): Payment-For-Customer. When true customer pays

    the bill.

Each org, extra and core value may have absolute value and relative (percentage) ration from the base ticket price.

Events

Event
GET /v1/resources/events/{idevent}

Returns information about the event.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • age_rating (number) – Age rating
  • created_at (datetime) – Event creation timestamp
  • id (string) – Event ID
  • lifetime (string) – Event lifetime in iCal format
  • media (array) – Media files
  • org (string) – Organizer ID
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – List of tags
  • title (object) – Title and description
  • updated_at (datetime) – Event update timestamp
  • venue (string) – Venue ID
Status Codes:

Request:

GET /v1/resources/events/5357baaff51600525c9e1397 HTTP/1.1
Accept: application/json
Authorization: key my-secret-api-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": null,
    "id": "5357baaff51600525c9e1397",
    "lifetime": "BEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20140710T000000\r\nDTEND;VALUE=DATE-TIME:20140910T000000\r\nEND:VEVENT\r\n",
    "org": "5357b929f51600525c9e1396",
    "removed": false,
    "status": "public",
    "tags": [
        "кошка",
        "мука"
    ],
    "title": {
        "desc": null,
        "text": "Семинар: милые котята"
    },
    "updated_at": null,
    "venue": null,
    "age_rating": 0
}
PATCH /v1/resources/events/{idevent}

Creates a new event.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Request JSON Object:
 
  • age_rating (number) – age rating
  • lifetime (string) – Event lifetime in iCal format
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – Event tags
  • title (object) – Title and description
  • venue (string) – Venue ID
Response Headers:
 
Response JSON Object:
 
  • age_rating (number) – Age rating
  • created_at (datetime) – Event creation timestamp
  • id (string) – Event ID
  • media (array) – Media files
  • lifetime (string) – Event lifetime in iCal format
  • org (string) – Organizer ID
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – List of tags
  • title (object) – Title and description
  • updated_at (datetime) – Event update timestamp
  • venue (string) – Venue ID
Status Codes:
DELETE /v1/resources/events/{idevent}

Removes an event.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Response Headers:
 
Status Codes:

Request:

DELETE /v1/resources/events/535fb19bdca6a90a9ca87882 HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{}
Events
GET /v1/resources/events
Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
  • fields-schema (string) – Fields Schema DSL
  • filter (string) – Custom filter
  • org (string) – Filters events by Organizer ID
  • removed (boolean) – Whenever include removed events
  • status (string) – Filters events by their status
Response Headers:
 
Response JSON Array of Objects:
 
  • age_rating (number) – Age rating
  • created_at (datetime) – Event creation timestamp
  • id (string) – Event ID
  • lifetime (string) – Event lifetime in iCal format
  • org (string) – Organizer ID
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – List of tags
  • title (object) – Title and description
  • updated_at (datetime) – Event update timestamp
  • venue (string) – Venue ID
Response JSON Object:
 
Status Codes:

Request:

GET /v1/resources/events HTTP/1.1
Accept: application/json
Authorization: key my-secret-api-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "created_at": null,
        "id": "5357baaff51600525c9e1397",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20140710T000000\r\nDTEND;VALUE=DATE-TIME:20140910T000000\r\nEND:VEVENT\r\n",
        "org": "5357b929f51600525c9e1396",
        "place": {
            "address": "Театр кошек Юрия Куклачева",
            "city": null,
            "country": null,
            "point": null
        },
        "removed": false,
        "status": "public",
        "tags": [
            "кошка",
            "мука"
        ],
        "title": {
            "desc": null,
            "text": "Семинар: милые котята"
        },
        "updated_at": null,
        "venue": null,
        "age_rating": 0
    },
    {
        "created_at": null,
        "id": "5368b3cc9583cb96a035758e",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20140810T190000\r\nDTEND;VALUE=DATE-TIME:20140810T220000\r\nEND:VEVENT\r\n",
        "org": "5357b929f51600525c9e1396",
        "place": {
            "address": "Arena Moscow",
            "city": null,
            "country": null,
            "point": null
        },
        "removed": false,
        "status": "public",
        "tags": [
            "концерты"
        ],
        "title": {
            "desc": null,
            "text": "MEGADETH"
        },
        "updated_at": null,
        "venue": null,
        "age_rating": 0
    },
    {
        "created_at": null,
        "id": "5368b3d39583cb96a035758f",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20140813T190000\r\nDTEND;VALUE=DATE-TIME:20140813T220000\r\nEND:VEVENT\r\n",
        "org": "5357b929f51600525c9e1396",
        "removed": false,
        "status": "public",
        "tags": [
            "концерты"
        ],
        "title": {
            "desc": null,
            "text": "ДДТ. Презентация альбома «Прозрачный»"
        },
        "updated_at": null,
        "venue": null,
        "age_rating": 0
    },
    {
        "created_at": null,
        "id": "5368b3d49583cb96a0357590",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20140916T210000\r\nDTEND;VALUE=DATE-TIME:20140916T230000\r\nEND:VEVENT\r\n",
        "org": "53555b2256c02c17cb75791c",
        "removed": false,
        "status": "public",
        "tags": [
            "концерты"
        ],
        "title": {
            "desc": null,
            "text": "Смысловые Галлюцинации. 25 лет в темноте"
        },
        "updated_at": null,
        "venue": null,
        "age_rating": 0
    }
]
POST /v1/resources/events

Creates a new event.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Request JSON Object:
 
  • age_rating (number) – age rating
  • lifetime (string) – Event lifetime in iCal format
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – Event tags
  • title (object) – Title and description
  • venue (string) – Venue ID
Response Headers:
 
Response JSON Object:
 
  • age_rating (number) – Age rating
  • created_at (datetime) – Event creation timestamp
  • id (string) – Event ID
  • media (array) – Media files
  • lifetime (string) – Event lifetime in iCal format
  • org (string) – Organizer ID
  • removed (boolean) – Deletion flag
  • status (string) – Event status
  • tags (array) – List of tags
  • title (object) – Title and description
  • updated_at (datetime) – Event update timestamp
  • venue (string) – Venue ID
Status Codes:

Geo Data

Countries
GET /v1/resources/countries

Returns list of countries.

Request Headers:
 
Response Headers:
 
Query Parameters:
 
  • ids (string) – List of object ids to return
  • limit (number) – Limit returned collection by specified number
  • offset (number) – Skip specified number of object from start
  • suggest (string) – Asks to suggest the countries which contains specified substring
  • fields-schema (string) – Fields Schema DSL
Response JSON Array of Objects:
 
  • id (string) – Country ID
  • name (object) – Mapping of locale to localized name
  • type (string) – Object type
Status Codes:

Request:

GET /v1/resources/countries?limit=4 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "id": "AF",
        "name": {
            "default": "Afghanistan",
            "en": "Afghanistan"
        },
        "type": "country"
    },
    {
        "id": "AX",
        "name": {
            "default": "Aland Islands",
            "en": "Aland Islands"
        },
        "type": "country"
    },
    {
        "id": "AL",
        "name": {
            "default": "Albania",
            "en": "Albania"
        },
        "type": "country"
    },
    {
        "id": "DZ",
        "name": {
            "default": "Algeria",
            "en": "Algeria"
        },
        "type": "country"
    }
]

When you don’t really know which country you’re looking for, you can pass suggest query parameter to filter alike countries by the specified name:

Request:

GET /v1/resources/countries?suggest=Rus HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "id": "RU",
        "name": {
            "default": "Russia",
            "en": "Russia"
        },
        "type": "country"
    }
]
Cities
GET /v1/resources/cities

Returns list of cities.

Request Headers:
 
Response Headers:
 
Query Parameters:
 
  • ids (string) – List of object ids to return
  • limit (number) – Limit returned collection by specified number
  • offset (number) – Skip specified number of object from start
  • suggest (string) – Asks to suggest the countries which contains specified substring
  • sort (str) – sort by field in django-style (“population” or “-populanion”)
  • fields-schema (string) – Fields Schema DSL
Response JSON Array of Objects:
 
  • country (string) – Country ID
  • id (object) – City ID
  • name (object) – Mapping of locale to localized name
  • timezone (string) – Timezone in Olson database format
  • type (string) – Object type
  • populanion (int) – populanion
Status Codes:

Request:

GET /v1/resources/cities?country=ru&sort=-population&limit=2 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
Server: nginx
Transfer-Encoding: chunked

[
    {
        "name": {
            "be": "\u0413\u043e\u0440\u0430\u0434 \u041c\u0430\u0441\u043a\u0432\u0430",
            "fr": "Moscou",
            "ru": "\u041c\u043e\u0441\u043a\u0432\u0430",
            "default": "Moscow",
            "en": "Moscow",
            "zh": "\u83ab\u65af\u79d1"
        },
        "country": "RU",
        "type": "city",
        "population": 10381222,
        "id": 524901,
        "timezone": "Europe/Moscow"
    },
    {
        "name": {
            "default": "Saint Petersburg",
            "en": "Saint-Petersburg",
            "fr": "Saint-P\u00e9tersbourg",
            "ru": "\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433"
        },
        "country": "RU",
        "type": "city",
        "population": 5028000,
        "id": 498817,
        "timezone": "Europe/Moscow"
    }
]

Media Files

Attachment
GET /v1/resources/attachment/{idatt}
Request Headers:
 
Parameters:
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • author (string) – Partner ID
  • content_type (string) – MIME type
  • created_at (datetime) – File creation timestamp
  • id (string) – Attachment ID
  • length (number) – File content length
  • md5 (string) – MD5 hash from file`s content
  • updated_at (datetime) – File update timestamp
  • url (string) – Direct URL to the file
Status Codes:

Request:

GET /v1/resources/attachments/53f1d8ab9437bdca80a97882 HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "author": "8ab53f1d94dca37b8088a972",
    "content_type": "image/gif",
    "created_at": "2014-10-02T10:42:28.288000+00:00",
    "id": "53f1d8ab9437bdca80a97882",
    "length": 4201,
    "md5": "bfd55d7efd971d30d1b429cfebde0b71",
    "removed": false,
    "updated_at": "2014-10-02T10:42:28.288000+00:00"
}
Attachments
GET /v1/resources/attachments
Request Headers:
 
Query Parameters:
 
Response Headers:
 
Response JSON Array of Objects:
 
  • author (string) – Partner ID
  • content_type (string) – MIME type
  • created_at (datetime) – File creation timestamp
  • id (string) – Attachment ID
  • length (number) – File content length
  • md5 (string) – MD5 hash from file`s content
  • updated_at (datetime) – File update timestamp
  • url (string) – Direct URL to the file
Status Codes:

Request:

GET /v1/resources/attachments HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "author": "8ab53f1d94dca37b8088a972",
        "content_type": "image/gif",
        "created_at": "2014-10-02T10:42:28.288000+00:00",
        "id": "53f1d8ab9437bdca80a97882",
        "length": 4201,
        "md5": "bfd55d7efd971d30d1b429cfebde0b71",
        "removed": false,
        "updated_at": "2014-10-02T10:42:28.288000+00:00"
    }
]
POST /v1/resources/attachments

Creates a new file.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Response Headers:
 
Response JSON Array of Objects:
 
  • created_at (datetime) – Deal creation timestamp
Response JSON Object:
 
  • event (string) – Event ID
  • id (string) – Deal ID
  • obj (string) – Partner ID
  • reversed_deal (boolean) – Deal made from subj to obj
  • status (string) – Deal status
  • subj (string) – Partner ID
  • term (object) – Deal Deal Terms
  • title (object) – Title and description
  • updated_at (datetime) – Deal update timestamp
Status Codes:

Request:

POST /v1/resources/attachments HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Content-Length: 4201
Content-Type: image/gif
Host: ticketscloud.org

<...data...>

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "author": "8ab53f1d94dca37b8088a972",
    "content_type": "image/gif",
    "created_at": "2014-10-02T10:42:28.288000+00:00",
    "id": "53f1d8ab9437bdca80a97882",
    "length": 4201,
    "md5": "bfd55d7efd971d30d1b429cfebde0b71",
    "removed": false,
    "updated_at": "2014-10-02T10:42:28.288000+00:00"
}

Orders

Order
GET /v1/resources/orders/{idorder}

Returns information about specified order.

Request Headers:
 
Parameters:
  • idorder (string) – Order ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • customer (object) – Customer information
  • created_at (datetime) – Partner creation timestamp
  • deal (string) – Deal ID
  • event (string) – Event ID
  • id (string) – Order ID
  • reserved_till (datetime) – Related Legal
  • rules (object) – Rules mapping
  • vendor (string) – vendor ID
  • status (string) – Order status
  • tickets (array) – List of ordered tickets ids
  • promocodes (array) – List of promocode as objects
  • updated_at (datetime) – Partner update timestamp
  • value – Value
Status Codes:

Request:

GET /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "customer": {},
    "created_at": null,
    "deal": "535fb1f1dca6a9d1638f2008",
    "event": "5357baaff51600525c9e1397",
    "id": "537e1d95f05f951cded9cb02",
    "reserved_till": null,
    "rules": {
        "5360a75a2b590f1c88e8680c": "537368ff1b9bf9d05cca835a"
    },
    "vendor": null,
    "status": "executed",
    "tickets": [
        "537df47b6ab04735203a7219",
        "53b9421428422ec1b9cafbb5"
    ],
    "updated_at": null,
    "value": null
}
PATCH /v1/resources/orders/{idorder}

Updates order data.

Request Headers:
 
Parameters:
  • idorder (string) – Order ID
Query Parameters:
 
Request JSON Object:
 
  • customer (object) – Customer information
  • status (string) – Order status
  • tickets (array) – List of ordered tickets ids
  • all_or_nothing (bool) – reserve all tickets or not resetve nothing
  • promocodes (array) – List of promocode as strings (field code)
Response Headers:
 
Response JSON Object:
 
  • customer (object) – Customer information
  • created_at (datetime) – Partner creation timestamp
  • deal (string) – Deal ID
  • event (string) – Event ID
  • id (string) – Order ID
  • reserved_till (datetime) – Related Legal
  • rules (object) – Rules mapping
  • vendor (string) – vendor ID
  • status (string) – Order status
  • tickets (array) – List of ordered tickets ids
  • updated_at (datetime) – Partner update timestamp
  • promocodes (array) – List of promocode as objects
  • value – Value
Status Codes:

Request:

PATCH /v1/resources/orders/535fb19bdca6a9d1638f2007 HTTP/1.1
Accept: application/json
Content-Type: applcation/json
Host: ticketscloud.org

{
    "tickets": [
        "537df47b6ab04735203a7219",
        "53b9421428422ec1b9cafbb5",
        "734b22afa3d5283e7146734d7e97b158"
    ]
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "customer": {},
    "created_at": null,
    "deal": "535fb1f1dca6a9d1638f2008",
    "event": "5357baaff51600525c9e1397",
    "id": "537e1d95f05f951cded9cb02",
    "reserved_till": null,
    "rules": {
        "5360a75a2b590f1c88e8680c": "537368ff1b9bf9d05cca835a"
    },
    "vendor": null,
    "status": "executed",
    "tickets": [
        "537df47b6ab04735203a7219",
        "53b9421428422ec1b9cafbb5",
        "734b22afa3d5283e7146734d7e97b158"
    ],
    "updated_at": null,
    "value": null
}
DELETE /v1/resources/orders/{idorder}
<header Accept:application/json
>header Content-Type:
 application/json
>header Transfer-Encoding:
 chunked
code 200:Ok
code 400:Invalid request parameters
code 401:Authentication required
code 403:Operation not allowed

Request:

DELETE /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2
Content-Type: application/json; charset=UTF-8
Server: nginx

{}
Orders
GET /v1/resources/orders
Request Headers:
 
Query Parameters:
 
Response Headers:
 
Response JSON Array of Objects:
 
  • customer (object) – Customer information
  • created_at (datetime) – Partner creation timestamp
  • deal (string) – Deal ID
  • event (string) – Event ID
  • id (string) – Order ID
  • reserved_till (datetime) – Related Legal
  • rules (object) – Rules mapping
  • status (string) – Order status
  • tickets (array) – List of ordered tickets ids
  • updated_at (datetime) – Partner update timestamp
  • value – Value
Response JSON Object:
 
  • vendor (string) – vendor ID
  • promocodes (array) – List of promocode as objects
Status Codes:

Request:

GET /v1/resources/orders HTTP/1.1
Accept: application/json
Authorization: key my-very-secret-key
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "customer": {},
        "created_at": "2014-07-16T21:00:00+00:00",
        "deal": "535fb1f1dca6a9d1638f2008",
        "event": "5357baaff51600525c9e1397",
        "id": "537e1d95f05f951cded9cb02",
        "reserved_till": "2015-07-16T21:00:00+00:00",
        "rules": {
            "5360a75a2b590f1c88e8680c": "537368ff1b9bf9d05cca835a"
        },
        "vendor": null,
        "status": "executed",
        "tickets": [
            "53b9421428422ec1b9cafbb5",
            "537df47b6ab04735203a7219"
        ],
        "updated_at": "2014-07-16T21:00:00+00:00",
        "value": null
    },
    {
        "customer": {
            "email": null,
            "first_name": null,
            "last_name": null,
            "user": null
        },
        "created_at": "2014-07-16T21:00:00+00:00",
        "deal": "535fb1f1dca6a9d1638f2008",
        "event": "5357baaff51600525c9e1397",
        "id": "5360a81f2b590f1c88e8680f",
        "reserved_till": null,
        "rules": {
            "5360a75a2b590f1c88e8680c": "537368ff1b9bf9d05cca835a"
        },
        "vendor": null,
        "status": "done",
        "tickets": [
            "5360a7fc2b590f1c88e8680e"
        ],
        "updated_at": "2014-07-16T21:00:00+00:00",
        "value": null
    }
]
Order Lifecycle
+----------+     +-------------+     +------+     +----------+
| executed | --> | in_progress | --> | done | --> | refunded |
+----------+     +-------------+     +------+     +----------+
  |                |
  |                |
  v                |
+----------+       |
| canceled | <-----+
+----------+
Order Creation

On order creation, you must specify the ticket IDs which customer wanted to buy:

POST /v1/resources/orders HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "tickets": ["ticket-id1", "ticket-id2"],
    "event": "event-id"
}

However, for some events there are no tickets which may have some specific serial number or ID, or you don’t even care about. In this cause you can order just some “random” tickets without explicitly specifying their IDs:

POST /v1/resources/orders HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "random": {
        "ticketset-id": 13,
    }
    "event": "event-id"
}

The Deal ID is optional and only need when you have to explicitly define the related deal which will be used for price calculation.

When order becomes created, it receives status executed.

Order updating

When order is created, the only information that could be updated is the ordered tickets:

PATCH /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "tickets": ["id2", "id3"]
}
PATCH /v1/resources/orders/{idorder} HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "random": {
        "ticketset-id": 13,
        "other-ticketset-id": 1,
    }
}

You must to always pass full set of tickets that have to be in the order, even if you want to add the single one onto it. If some tickets were ordered, but becomes missed on update their reservation gets removed.

Order Commit

When order is done and it’s time to pay the money for it, it must be updated to set status as in_progress:

PATCH /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "status": "in_progress"
}
Order Completion

When order had been paid, it must be updated to set status as done:

PATCH /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "status": "done"
}
Order Cancellation

However, sometime you’ll have to cancel the order. This could be done with easy by order deletion:

DELETE /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key

This operation is equivalent to manually status update to canceled:

PATCH /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "status": "canceled"
}
Update Customer Information
PATCH /v1/resources/orders/537e1d95f05f951cded9cb02 HTTP/1.1
Authorization: key my-very-secret-key
Content-Type: application/json

{
    "customer": {
        "first_name": "John",
        "last_name": "Smith",
        "email": "user@mail.us",
    }
}

Partners

Partner

Partner is an special kind of User which manages event, provides tickets and sign contracts with others. It’s different since in most cases single Partner represents some organization which may be managed by multiple different users. People come and gone, partners are more persistent thing in the world.

GET /v1/resources/partners/{idpartner}

Returns partner information.

Request Headers:
 
Parameters:
  • idpartner (string) – Partner ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • channels (string) – Partner creation timestamp
  • contact (object) – Contact information
  • created_at (datetime) – Partner creation timestamp
  • desc (string) – Description
  • director (string) – CEO
  • id (string) – Partner ID
  • legal (object) – Related Legal
  • name (string) – Partner name
  • media (array) – Media files
  • removed (boolean) – Deleted flag
  • roles (array) – Assigned roles
  • tags (array) – Tags
  • updated_at (datetime) – Partner update timestamp
Status Codes:

Request:

GET /v1/resources/partners/535fb19bdca6a9d1638f2007 HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "channels": "Все доступные каналы распространения",
    "contact": {
        "address": "г.Москва, ул. Берсеневский переулок, 2с1",
        "email": "info@nanobilet.ru",
        "id": null,
        "phones": ["+79101002030"],
        "www": "http://nanobilet.ru"
    },
    "created_at": null,
    "desc": "Первый агент системы",
    "director": "Егор Егерев",
    "id": "535fb19bdca6a9d1638f2007",
    "legal": null,
    "name": "Nanobilet",
    "removed": false,
    "roles": ["agent"],
    "tags": ["музыка", "вечеринки", "концерты"],
    "updated_at": null,
    "user": {
        "created_at": null,
        "email": "ag@tc.ru",
        "first_name": "Егор",
        "id": "535fb11ddca6a9d1638f2006",
        "last_name": "Егерев",
        "partners": ["535fb19bdca6a9d1638f2007"],
        "tags": [],
        "updated_at": null
    }
}
PATCH /v1/resources/partners/{idpartner}

Updates specific partner fields.

Request Headers:
 
Parameters:
  • idpartner (string) – Partner ID
Query Parameters:
 
Request JSON Object:
 
  • channels (string) – Partner creation timestamp
  • contact (object) – Contact information
  • desc (string) – Description
  • director (string) – CEO
  • legal (object) – Related Legal
  • name (string) – Partner name
  • media (array) – Media files
  • removed (boolean) – Deleted flag
  • roles (array) – Assigned roles
  • tags (array) – Tags
  • updated_at (datetime) – Partner update timestamp
Response Headers:
 
Response JSON Object:
 
  • channels (string) – Partner creation timestamp
  • contact (object) – Contact information
  • created_at (datetime) – Partner creation timestamp
  • desc (string) – Description
  • director (string) – CEO
  • id (string) – Partner ID
  • legal (object) – Related Legal
  • media (array) – Media files
  • name (string) – Partner name
  • removed (boolean) – Deleted flag
  • roles (array) – Assigned roles
  • tags (array) – Tags
  • updated_at (datetime) – Partner update timestamp
Status Codes:
Partners

Collection of Partner objects.

GET /v1/resources/partners

Returns list of Partner objects.

Request Headers:
 
Query Parameters:
 
  • ids (string) – List of IDs to return
  • fields-schema (string) – Fields Schema DSL
Response Headers:
 
Response JSON Object:
 
  • channels (string) – Partner creation timestamp
  • contact (object) – Contact information
  • created_at (datetime) – Partner creation timestamp
  • desc (string) – Description
  • director (string) – CEO
  • id (string) – Partner ID
  • legal (object) – Related Legal
  • media (array) – Media files
  • name (string) – Partner name
  • removed (boolean) – Deleted flag
  • roles (array) – Assigned roles
  • tags (array) – Tags
  • updated_at (datetime) – Partner update timestamp
Status Codes:

Request:

GET /v1/resources/partners HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "channels": null,
        "contact": {},
        "created_at": null,
        "desc": null,
        "director": null,
        "id": "5357b929f51600525c9e1396",
        "legal": null,
        "name": "Organizator",
        "removed": false,
        "roles": ["org"],
        "tags": [],
        "updated_at": null,
        "user": {
            "created_at": null,
            "email": "org@tc.ru",
            "first_name": "Org",
            "id": "53555b2256c02c17cb75791c",
            "last_name": "Organizator",
            "partners": ["5357b929f51600525c9e1396"],
            "tags": [],
            "updated_at": null
        }
    },
    {
        "channels": "Все доступные каналы распространения",
        "contact": {
            "address": "г.Москва, ул. Берсеневский переулок, 2с1",
            "email": "info@nanobilet.ru",
            "id": null,
            "phones": ["+79101002030"],
            "www": "http://nanobilet.ru"
        },
        "created_at": null,
        "desc": "Первый агент системы",
        "director": "Егор Егерев",
        "id": "535fb19bdca6a9d1638f2007",
        "legal": null,
        "name": "Nanobilet",
        "removed": false,
        "roles": ["agent"],
        "tags": ["музыка", "вечеринки", "концерты"],
        "updated_at": null,
        "user": {
            "created_at": null,
            "email": "ag@tc.ru",
            "first_name": "Егор",
            "id": "535fb11ddca6a9d1638f2006",
            "last_name": "Егерев",
            "partners": ["535fb19bdca6a9d1638f2007"],
            "tags": [],
            "updated_at": null
        }
    }
]

Promocodes

Promocodes
GET /v1/resources/events/{event_id}/promocodes/{promocode_id}

Returns information about the promocode

Request Headers:
 
Parameters:
  • event_id (string) – Event ID
  • promocode_id (string) – promocode ID
Query Parameters:
 
Request JSON Object:
 
  • sets (arrray) – List of ticketsets
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
  • discount (dict) – discount value (percengate or fixed keys)
  • amount (number) – amount of promocode uses
  • code (string) – Code for users
  • lifetime (string) –
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – Set creation timestamp
  • updated_at (datetime) – Set update timestamp
  • event (string) – Event ID
  • sets (arrray) – List of ticketsets
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
  • discount (dict) – discount value percengate or fixed
  • amount (number) – amount of promocode uses
  • code (string) – Code for users
  • lifetime (string) –
  • counter (dict) – promocode usage information
Status Codes:
POST /v1/resources/events/{event_id}/promocodes

Create promocode

Request Headers:
 
Parameters:
  • promocode_id (string) – promocode ID
Query Parameters:
 
Request JSON Object:
 
  • sets (arrray) – List of ticketsets
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
  • discount (dict) – discount value (percengate or fixed keys)
  • amount (number) – amount of promocode uses
  • code (string) – Code for users
  • lifetime (string) –
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – Set creation timestamp
  • updated_at (datetime) – Set update timestamp
  • event (string) – Event ID
  • sets (arrray) – List of ticketsets
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
  • discount (dict) – discount value percengate or fixed
  • amount (number) – amount of promocode uses
  • code (string) – Code for users
  • lifetime (string) –
  • counter (dict) – promocode usage information
Status Codes:
PATCH /v1/resources/events/{event_id}/promocodes/{promocode_id}

Edit promocode

Request Headers:
 
Parameters:
  • event_id (string) – Event ID
  • promocode_id (string) – promocode ID
Query Parameters:
 
Request JSON Object:
 
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – Set creation timestamp
  • updated_at (datetime) – Set update timestamp
  • event (string) – Event ID
  • sets (arrray) – List of ticketsets
  • name (string) – Name of promocode
  • desc (string) – Descriprion of promocode
  • discount (dict) – discount value percengate or fixed
  • amount (number) – amount of promocode uses
  • code (string) – Code for users
  • lifetime (string) –
  • counter (dict) – promocode usage information
Status Codes:

Tickets Sets

Tickets Set
GET /v1/resources/events/{idevent}/sets/{idset}

Returns information about the set.

Request Headers:
 
Parameters:
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • amount (number) – Amount tickets in set
  • amount_vacant (number) – Amount vacant tickets in set
  • created_at (datetime) – Set creation timestamp
  • current_price (string) – Current price for tickets in set
  • current_rule (object) – Current price calculation rule
  • created_at – Set creation timestamp
  • description (string) – Long text description
  • event (string) – Event ID
  • id (string) – Tickets Set ID
  • name (string) – Tickets Set short name
  • removed (boolean) – Deletion flag
  • rule (arrray) – List of rules
  • updated_at (datetime) – Set update timestamp
Status Codes:
PATCH /v1/resources/events/{idevent}/sets/{idset}

Updates set information.

Request Headers:
 
Parameters:
Query Parameters:
 
Request JSON Object:
 
  • amount (number) – Amount tickets in set
  • name (string) – Tickets Set short name
Response Headers:
 
Response JSON Object:
 
  • amount (number) – Amount tickets in set
  • amount_vacant (number) – Amount vacant tickets in set
  • created_at (datetime) – Set creation timestamp
  • current_price (string) – Current price for tickets in set
  • current_rule (object) – Current price calculation rule
  • created_at – Set creation timestamp
  • description (string) – Long text description
  • event (string) – Event ID
  • id (string) – Tickets Set ID
  • name (string) – Tickets Set short name
  • removed (boolean) – Deletion flag
  • rule (arrray) – List of rules
  • updated_at (datetime) – Set update timestamp
Status Codes:
DELETE /v1/resources/events/{idevent}/sets/{idset}

Deletes a set.

Request Headers:
 
Parameters:
Status Codes:
Tickets Sets
GET /v1/resources/events/{idevent}/sets

Returns list of existed sets

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
  • fields-schema (string) – Fields Schema DSL
  • filter (string) – Custom filter
  • org (string) – Filters sets by Organizer ID
  • removed (boolean) – Whenever include removed sets
  • status (string) – Filters sets by their status
Response Headers:
 
Response JSON Array of Objects:
 
  • amount (number) – Amount tickets in set
  • amount_vacant (number) – Amount vacant tickets in set
  • created_at (datetime) – Set creation timestamp
  • current_price (string) – Current price for tickets in set
  • current_rule (object) – Current price calculation rule
  • created_at – Set creation timestamp
  • description (string) – Long text description
  • event (string) – Event ID
  • id (string) – Tickets Set ID
  • name (string) – Tickets Set short name
  • removed (boolean) – Deletion flag
  • rule (arrray) – List of rules
  • updated_at (datetime) – Set update timestamp
Status Codes:
POST /v1/resources/events/{idevent}/sets

Creates a new set.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Request JSON Object:
 
  • amount (number) – Amount tickets in set
  • name (string) – Tickets Set short name
Response Headers:
 
Response JSON Object:
 
  • amount (number) – Amount tickets in set
  • amount_vacant (number) – Amount vacant tickets in set
  • created_at (datetime) – Set creation timestamp
  • current_price (string) – Current price for tickets in set
  • current_rule (object) – Current price calculation rule
  • created_at – Set creation timestamp
  • description (string) – Long text description
  • event (string) – Event ID
  • id (string) – Tickets Set ID
  • name (string) – Tickets Set short name
  • removed (boolean) – Deletion flag
  • rule (arrray) – List of rules
  • updated_at (datetime) – Set update timestamp
Status Codes:

Tickets

Ticket
GET /v1/resources/events/{idevent}/sets/{idset}/tickets/{idticket}

Returns information about the ticket.

Request Headers:
 
Parameters:
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • barcode (string) – Barcode (Code-128)
  • created_at (datetime) – Ticket creation timestamp
  • id (string) – Ticket ID
  • number (number) – Number
  • removed (boolean) – Deletion flag
  • serial (string) – Serial
  • set (string) – Tickets Set ID
  • status (string) – Ticket status
  • updated_at (datetime) – Ticket update timestamp
  • seat (object) –

    Information for seat

    • map (ObjectId) Map id
    • sector (ObjectId) Sector id
    • row (int) Row number
    • number (int) Seat number
Status Codes:
Tickets
GET /v1/resources/events/{idevent}/tickets
Request Headers:
 
Parameters:
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • barcode (string) – Barcode (Code-128)
  • created_at (datetime) – Ticket creation timestamp
  • id (string) – Ticket ID
  • number (number) – Number
  • removed (boolean) – Deletion flag
  • serial (string) – Serial
  • set (string) – Tickets Set ID
  • status (string) – Ticket status
  • updated_at (datetime) – Ticket update timestamp
  • seat (object) –

    Information for seat

    • map (ObjectId) Map id
    • sector (ObjectId) Sector id
    • row (int) Row number
    • number (int) Seat number
Status Codes:
Event’s Tickets
GET /v1/resources/events/{idevent}/tickets

Returns information about the all tickets in events.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • id (string) – Ticket ID
  • status (string) – Ticket status
  • set (string) – Tickets Set ID
  • reserved_till (datetime) – Ticket reserved till timestamp
  • seat (object) –

    Information for seat

    • map (ObjectId) Map id
    • sector (ObjectId) Sector id
    • row (int) Row number
    • number (int) Seat number
Status Codes:

Users

User

Users are represents the humans which works with TicketsCloud API: each has own credentials and association. Users can only update their information, create related partners and their keys.

GET /v1/resources/users/{user_id}

Returns information about user by the specified ID.

Request Headers:
 
Parameters:
  • user_id (string) – User ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • first_name (string) – User first name
  • id (string) – User unique ID
  • last_name – User last name
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
  • crm (object) –

    CRM cpecified info:

    • values orders values info:
      • avg
      • sum
    • counters some counters:
      • orders
      • tickets
Status Codes:

Request:

GET /v1/resources/users/53e241d137abbd588116ef3e HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 200 Ok
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-08-06T14:55:13.601000+00:00",
    "email": "user@domain.ltd",
    "first_name": null,
    "id": "53e241d137abbd588116ef3e",
    "last_name": null,
    "partners": [],
    "tags": [],
    "updated_at": "2014-08-06T14:55:13.601000+00:00",
    "crm": {
        "values": {
            "avg": "1000.00",
            "sum": "2000.00"
        },
        "counters": {
            "orders": 2,
            "tickets": 4
        }
    }
}
PATCH /v1/resources/users/{user_id}

Updates user information.

Request Headers:
 
Parameters:
  • user_id (string) – User ID
Query Parameters:
 
Request JSON Object:
 
  • email (string) – User email address
  • first_name (string) – User first name
  • last_name – User last name
  • password – New password
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • first_name (string) – User first name
  • id (string) – User unique ID
  • last_name – User last name
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
Status Codes:

Request:

PATCH /v1/resources/users/53da11a537abbd06b21cb254 HTTP/1.1
Accept: application/json
Content-Length: 45
Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=ticketscloud.org; Path=/
Host: ticketscloud.org

{"last_name": "Smith", "first_name": "John"}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-07-31T09:51:33.363000+00:00",
    "email": "user@domain.tld",
    "first_name": "John",
    "id": "53da11a537abbd06b21cb254",
    "last_name": "Smith",
    "partners": [],
    "tags": [],
    "updated_at": "2014-07-31T09:51:33.363000+00:00"
}
Users

Collection of User objects.

GET /v1/resources/users

Returns list of users.

Request Headers:
 
Query Parameters:
 
  • fields-schema (string) – Fields Schema DSL
  • suggest (string) – filter user on suggest
  • order_event (string) – event id
  • order_status (string) – order status filter (require order_event)
  • page (int) – page number
  • page-size (int) – number items on page
  • sort (str) – one of email, -email, suggest, -suggest
Response Headers:
 
Response JSON Array of Objects:
 
  • id (string) – User unique ID
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • first_name (string) – User first name
  • last_name (string) – User last name
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
Response JSON Object:
 
  • crm (object) –

    CRM cpecified info:

    • values orders values info:
      • avg
      • sum
    • counters some counters:
      • orders
      • tickets
Status Codes:

Request:

GET /v1/resources/users HTTP/1.1
Accept: application/json
Host: ticketscloud.org

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "created_at": "2014-08-06T14:55:13.601000+00:00",
        "email": "user@domain.ltd",
        "first_name": null,
        "id": "53e241d137abbd588116ef3e",
        "last_name": null,
        "partners": [],
        "tags": [],
        "updated_at": "2014-08-06T14:55:13.601000+00:00"
        "crm": {
            "values": {
                "avg": "1000.00",
                "sum": "2000.00"
            },
            "counters": {
                "orders": 2,
                "tickets": 4
            }
        }
    },
    {
        "created_at": "2014-08-06T14:56:46.465000+00:00",
        "email": "user@domain.com",
        "first_name": null,
        "id": "53e2422e37abbd588116ef3f",
        "last_name": null,
        "partners": [],
        "tags": [],
        "updated_at": "2014-08-06T14:56:46.465000+00:00"
        "crm": {
            "values": {
                "avg": "1000.00",
                "sum": "2000.00"
            },
            "counters": {
                "orders": 2,
                "tickets": 4
            }
        }
    }
]
POST /v1/resources/users

Registers a new user.

Request Headers:
 
Query Parameters:
 
Request JSON Object:
 
  • email (string) – User email
  • password (string) – User password
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • id (string) – User unique ID
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
Status Codes:

Request:

POST /v1/resources/users HTTP/1.1
Accept: application/json
Content-Length: 48
Host: ticketscloud.org

{
    "email": "user@domain.tld",
    "password": "s3cr1t"
}

Response:

HTTP/1.1 201 Created
Content-Length: 190
Content-Type: application/json; charset=UTF-8

{
    "created_at": "2014-08-06T14:59:20.323853+00:00",
    "email": "user@domain.tld",
    "id": "53e242c837abbd588116ef41",
    "partners": [],
    "tags": [],
    "updated_at": "2014-08-06T14:59:20.323853+00:00"
}
GET /v1/resources/users/:id/orders
Request Headers:
 
Query Parameters:
 
  • fields-schema (string) – Fields Schema DSL
  • event (string) – event id
  • status (string) – filter on order status
Status Codes:

Return list of orders objects.

Venues

Venue
GET /v1/resources/venues/{idvenue}

Returns information about the venue.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
  • idvenue (string) – Venue ID
Query Parameters:
 
Response Headers:
 
Response JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • created_at (datetime) – Partner creation timestamp
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
  • removed (boolean) – Deletion flag
  • updated_at (datetime) – Partner update timestamp
Status Codes:
PATCH /v1/resources/venues/{idvenue}

Updates venue information.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
  • idvenue (string) – Venue ID
Query Parameters:
 
Request JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
Response Headers:
 
Response JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • created_at (datetime) – Venue creation timestamp
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
  • removed (boolean) – Deletion flag
  • updated_at (datetime) – Venue update timestamp
Status Codes:
DELETE /v1/resources/venues/{idvenue}

Deletes a venue.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
  • idvenue (string) – Venue ID
Status Codes:
Venues
GET /v1/resources/venues
Request Headers:
 
Parameters:
  • idevent (string) – Event ID
  • idvenue (string) – Venue ID
Query Parameters:
 
  • fields-schema (string) – Fields Schema DSL
  • filter (string) – Custom filter
  • org (string) – Filters venues by Organizer ID
  • removed (boolean) – Whenever include removed venues
  • status (string) – Filters venues by their status
Response Headers:
 
Response JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • created_at (datetime) – Partner creation timestamp
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
  • removed (boolean) – Deletion flag
  • updated_at (datetime) – Partner update timestamp
Status Codes:
POST /v1/resources/venues

Creates a new venue.

Request Headers:
 
Parameters:
  • idevent (string) – Event ID
  • idvenue (string) – Venue ID
Query Parameters:
 
Request JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
Response Headers:
 
Response JSON Object:
 
  • address (string) – Venue location address
  • city (number) – City ID
  • country (string) – Country ID
  • created_at (datetime) – Venue creation timestamp
  • description (string) – Long text description
  • id (string) – Venue ID
  • name (string) – Venue short name
  • point (object) – GeoJSON point
  • removed (boolean) – Deletion flag
  • updated_at (datetime) – Venue update timestamp
Status Codes:

Services

Services are used to perform some operation upon specific objects.

Simple service for lazy integration

GET /v1/services/simple/events

Returns comprehensive information about available events.

Request Headers:
 
Query Parameters:
 
  • ids – Returns only events with ids
  • org – Filter by org
  • tags – comma separated list of tags
  • lifetime__range – two comma separated datetimes
  • price__range – two comma separated numbers
  • created_at__since – Returns events which were created since the specified date.
  • updated_at__since – Returns events which were updated since the specified date.
  • country – filter by coutntry
  • city – filter by city
  • venue – filter by venue
  • page – page number
  • page_size – number events on page
  • sort

    Sort events. One of “start”, “end”, “price”, “-start”, “-end” or “-price”.

    • start sort by events start
    • end sort by events start
    • price sort by minimal price
Response Headers:
 
Response JSON Array of Objects:
 
  • id (string) – Event id
  • age_rating (string) –
  • created_at (datetime) – Event creation timestamp
  • deal (object) –

    Deal terms (only for agents)

    • org
    • agent
    • extra
    • pfc
  • lifetime (string) – Event duration in iCal format
  • map (object) –
  • media (array) – Media files
  • org (object) –

    Organizer information object

    • id (string)
    • contact (object)
    • desc (string)
    • media (object)
    • name (string)
    • tags (list of string)
  • sets (array) –

    List of available sets including:

    • id (string): Set id
    • seats (map): Seats in this set
    • amount (number): Amount tickets in set
    • amount_vacant (number): Amount of available tickets in set
    • name (string): Description
    • price (string): Cost of single ticket including the terms from the current rule
    • price_extra (string): Extra price on top of base one
    • price_org (string): Base price for tickets provided by a organizer
    • rules (array of objects): List of rules applicable to this set. The current one is defined by the flag current: true
    • sector (string): sector if map exist
  • status (string) – event status
  • tags (array) – List of event tags
  • tickets_amount (number) – amount tickets
  • tickets_amount_vacant (number) – amount vacant tickets
  • title (object) –

    Event name and description

    • desc (string)
    • text (string)
  • updated_at (datetime) – Event last update timestamp
  • venue (object) –

    Venue information object

    • id (string)
    • address (string)
    • city (object) City object
    • country (object) Country object
    • desc (string)
    • name (string)
    • point (object) GeoJSON Point
Status Codes:

Request

GET /v1/services/simple/events HTTP/1.1
Accept: application/json
Authorization: key your-very-secret-key
Host: ticketscloud.org

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

[
    {
        "created_at": "2014-09-19T10:30:24.388000+00:00",
        "deal": {
            "org": "93.0%",
            "agent": "7.0%",
            "extra": "10.0%",
            "pfc": false
        },
        "id": "541c05c037abbd1af8b3398e",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART:20141001T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
        "media": {
            "logo": {
                "author": "535fb19bdca6a9d1638f2007",
                "content_type": "image/jpeg",
                "id": "545b686b37abbd08a96e50a5",
                "length": 72122,
                "md5hash": "0db79df4bbef2e847e31e46508f1d43e",
                "url": "https://s3-eu-west-1.amazonaws.com/media.ticketscloud/9a44bb963ae44db8a443d1f3c19ed39e.jpeg"
            }
        },
        "org": {
            "contact": {},
            "desc": null,
            "id": "5357b929f51600525c9e1396",
            "name": "Organizator",
            "tags": []
        },
        "sets": [
            {
                "amount": 100,
                "amount_vacant": 13,
                "id": "541c05c037abbd1af8b33992",
                "name": "foo",
                "price": "1105.5",
                "price_extra": "100.5",
                "price_org": "1005.00",
                "rules": [
                    {
                        "cal": "BEGIN:VEVENT\r\nDTSTART:20140901T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
                        "current": true,
                        "id": "541c05c037abbd1af8b33990",
                        "price": "1105.5",
                        "price_extra": "100.5",
                        "price_org": "1005.00"
                    }
                ]
            }
        ],
        "tags": [
            "концерты",
            "вечеринки"
        ],
        "title": {
            "desc": "Возвращение музыканта в хорошем расположении духа и с новой программой",
            "text": "Найк Борзов"
        },
        "updated_at": "2014-09-19T10:30:24.793000+00:00",
        "venue": {
            "address": "Кутузовский просп., 25",
            "city": {},
            "country": {},
            "desc": "Представления с участием кошек и Куклачевых",
            "id": "53eca6fd0fc5f66be2610d8c",
            "name": "Театр кошек Юрия Куклачева",
            "point": {
                "coordinates": [
                    55.7444151,
                    37.5458909
                ],
                "type": "Point"
            }
        }
    },
    {
        "created_at": "2014-09-19T11:10:31.922000+00:00",
        "deal": {
            "org": "93.0%",
            "agent": "7.0%",
            "extra": "10.0%",
            "pfc": false
        },
        "id": "541c0f2737abbd1c64b61b48",
        "lifetime": "BEGIN:VEVENT\r\nDTSTART:20141001T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
        "org": {
            "contact": {},
            "desc": null,
            "id": "5357b929f51600525c9e1396",
            "name": "Organizator",
            "tags": []
        },
        "sets": [
            {
                "amount": 100,
                "amount_vacant": 13,
                "id": "541c0f2737abbd1c64b61b4c",
                "name": "foo",
                "price": "1105.5",
                "price_extra": "100.5",
                "price_org": "1005.00",
                "rules": [
                    {
                        "cal": "BEGIN:VEVENT\r\nDTSTART:20140901T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
                        "current": true,
                        "id": "541c0f2737abbd1c64b61b4a",
                        "price": "1105.5",
                        "price_extra": "100.5",
                        "price_org": "1005.00"
                    }
                ]
            }
        ],
        "tags": [
            "концерты",
            "вечеринки"
        ],
        "title": {
            "desc": "Возвращение музыканта в хорошем расположении духа и с новой программой",
            "text": "Найк Борзов"
        },
        "updated_at": "2014-09-19T11:10:32.235000+00:00",
        "venue": {
            "address": "Кутузовский просп., 25",
            "city": {},
            "country": {},
            "desc": "Представления с участием кошек и Куклачевых",
            "id": "53eca6fd0fc5f66be2610d8c",
            "name": "Театр кошек Юрия Куклачева",
            "point": {
                "coordinates": [
                    55.7444151,
                    37.5458909
                ],
                "type": "Point"
            }
        }
    }
]
GET /v1/services/simple/events/{idevent}

Returns comprehensive information about specific event.

Parameters:
Request Headers:
 
Query Parameters:
 
  • updated_at__gt – Returns events which were updated since the specified date. The date should be defined in ISO-8601 format.
Response Headers:
 
Response JSON Array of Objects:
 
  • id (string) – Event id
  • age_rating (string) –
  • created_at (datetime) – Event creation timestamp
  • deal (object) –

    Deal terms (only for agents)

    • org
    • agent
    • extra
    • pfc
  • lifetime (string) – Event duration in iCal format
  • map (object) –
  • media (array) – Media files
  • org (object) –

    Organizer information object

    • id (string)
    • contact (object)
    • desc (string)
    • media (object)
    • name (string)
    • tags (list of string)
  • sets (array) –

    List of available sets including:

    • id (string): Set id
    • amount (number): Amount tickets in set
    • amount_vacant (number): Amount of available tickets in set
    • name (string): Description
    • price (string): Cost of single ticket including the terms from the current rule
    • price_extra (string): Extra price on top of base one
    • price_org (string): Base price for tickets provided by a organizer
    • rules (array of objects): List of rules applicable to this set. The current one is defined by the flag current: true
    • sector (string): sector if map exist
  • status (string) – event status
  • tags (array) – List of event tags
  • tickets_amount (number) – amount tickets
  • tickets_amount_vacant (number) – amount vacant tickets
  • title (object) –

    Event name and description

    • desc (string)
    • text (string)
  • updated_at (datetime) – Event last update timestamp
  • venue (object) –

    Venue information object

    • id (string)
    • address (string)
    • city (object) City object
    • country (object) Country object
    • desc (string)
    • name (string)
    • point (object) GeoJSON Point
Status Codes:

Request

GET /v1/services/simple/events/5357baaff51600525c9e1397 HTTP/1.1
Accept: application/json
Authorization: key your-very-secret-key
Host: ticketscloud.org

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked

{
    "created_at": "2014-09-19T11:10:31.922000+00:00",
    "deal": {
        "org": "93.0%",
        "agent": "7.0%",
        "extra": "10.0%",
        "pfc": false
    },
    "id": "541c0f2737abbd1c64b61b48",
    "lifetime": "BEGIN:VEVENT\r\nDTSTART:20141001T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
    "org": {
        "contact": {},
        "desc": null,
        "id": "5357b929f51600525c9e1396",
        "name": "Organizator",
        "tags": []
    },
    "sets": [
        {
            "amount": 100,
            "amount_vacant": 13,
            "id": "541c0f2737abbd1c64b61b4c",
            "name": "foo",
            "price": "1105.5",
            "price_extra": "100.5",
            "price_org": "1005.00",
            "rules": [
                {
                    "cal": "BEGIN:VEVENT\r\nDTSTART:20140901T170000Z\r\nDTEND:20141001T190000Z\r\nEND:VEVENT\r\n",
                    "current": true,
                    "id": "541c0f2737abbd1c64b61b4a",
                    "price": "1105.5",
                    "price_extra": "100.5",
                    "price_org": "1005.00"
                }
            ]
        }
    ],
    "tags": [
        "концерты",
        "вечеринки"
    ],
    "title": {
        "desc": "Возвращение музыканта в хорошем расположении духа и с новой программой",
        "text": "Найк Борзов"
    },
    "updated_at": "2014-09-19T11:10:32.235000+00:00",
    "venue": {
        "address": "Кутузовский просп., 25",
        "city": {},
        "country": {},
        "desc": "Представления с участием кошек и Куклачевых",
        "id": "53eca6fd0fc5f66be2610d8c",
        "name": "Театр кошек Юрия Куклачева",
        "point": {
            "coordinates": [
                55.7444151,
                37.5458909
            ],
            "type": "Point"
        }
    }
}

Who Am I

POST /v1/services/whoami

Initiates user cookie session.

Request Headers:
 
Request JSON Object:
 
  • email (string) – User email
  • password (string) – User password
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • first_name (string) – User first name
  • id (string) – User unique ID
  • last_name – User last name
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
Status Codes:

Request:

POST /v1/services/whoami HTTP/1.1
Accept: application/json
Content-Length: 49
Content-Type: application/json; charset=utf-8
Host: ticketscloud.org

{
    "email": "user@domain.tld",
    "password": "s3cr1t"
}

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Server: nginx
Set-Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Path=/
Set-Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=ticketscloud.org; Path=/
Set-Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=.ticketscloud.org; Path=/
Transfer-Encoding: chunked

{
    "created_at": "2014-07-31T09:51:33.363000+00:00",
    "email": "user@domain.tld",
    "first_name": null,
    "id": "53da11a537abbd06b21cb254",
    "last_name": null,
    "partners": [],
    "tags": [],
    "updated_at": "2014-07-31T09:51:33.363000+00:00"
}
GET /v1/services/whoami

Returns information about authenticated user.

Request Headers:
 
  • Acceptapplication/json
  • Cookie – Authorization token
Response Headers:
 
Response JSON Object:
 
  • created_at (datetime) – User creation timestamp
  • email (string) – User email address
  • first_name (string) – User first name
  • id (string) – User unique ID
  • last_name – User last name
  • partners (array) – List of the Partners which users may operate with
  • tags (array) – List of the associated tags
  • updated_at (datetime) – User update timestamp
Status Codes:

Request:

GET /v1/services/whoami HTTP/1.1
Accept: application/json
Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=ticketscloud.org; Path=/
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Server: nginx
Transfer-Encoding: chunked

{
    "created_at": "2014-07-31T09:51:33.363000+00:00",
    "email": "user@domain.tld",
    "first_name": null,
    "id": "53da11a537abbd06b21cb254",
    "last_name": null,
    "partners": [],
    "tags": [],
    "updated_at": "2014-07-31T09:51:33.363000+00:00"
}
DELETE /v1/services/whoami

Closes user cookie session.

Request Headers:
 
  • Acceptapplication/json
  • Cookie – Authorization token
Response Headers:
 
Status Codes:

Request:

DELETE /v1/services/whoami HTTP/1.1
Accept: application/json
Cookie: auth_tkt="FiYmQwNmIyMWNiMjU0!userid_type:b64unicode"; Domain=ticketscloud.org; Path=/
Host: ticketscloud.org

Response:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Server: nginx
Set-Cookie: auth_tkt=; Domain=.ticketscloud.org; Max-Age=0; Path=/; expires=Wed, 31-Dec-97 23:59:59 GMT
Transfer-Encoding: chunked

{}

Glossary

API Key
A special token used to authenticate partner for API usage.
Customer
A person who buys tickets.
Deal
A contract made between distributor and organizer that allows the first to sell tickets for the certain events.
Distributor
A partner who sells tickets for events.
Event
Some organized event: lecture, concert, performance, show, party etc.
Order
A financial document that contains bought tickets, their price etc.
Organizer
A partner who organizes events.
Ticket
The matter of everything. That’s why we here.
Ticket Set
A group of tickets.
Partner
A company which works with TicketsCloud. Could be distributor or organizer.
User
A person who represents some partner.