Contents:
In this chapter you’ll find HTTP API common bits about design and workflow.
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.
TicketsCloud uses the following HTTP request methods:
Request the specified item.
This method works like GET except that request with it doesn’t returns payload content.
Create a new object or makes some action that doesn’t creates a new resource.
Used to update a specified resource or create a new one on the specified resource.
Deletes the specified resource, destroys associated object or cancels some action.
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.
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
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.
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.
Request completed successfully.
Resource object had been created successfully.
Request has been accepted, but the corresponding operation may not have completed. This is used for background operations, such as database compaction.
Bad request structure. The error can indicate an error with the request URL, path, headers or payload data.
The item requested was not available using the supplied authorization, or authorization was not supplied.
The requested item or operation is forbidden.
The requested content could not be found. The content will include further information, as a JSON object, if available.
The requested content type is not supported by the server.
Request resulted in an update conflict.
The content types supported, and the content type of the information being requested or submitted indicate that the content type is not supported.
The request was invalid, either because the supplied JSON was invalid, or invalid information was supplied as part of the request.
Something really gone wrong.
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.
The length (in bytes) of the returned content.
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.
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.
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.
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:
"A String"
true
or false
value. You can use these strings
directly. For example:true
["one", "two", "three"]
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.
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.
Примечание
If you’re developer jump to Get Your Widget.
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.
Now it’s time to make a deals! Deals are special business object which allows Distributor to sell tickets on events provided by Organizers.
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.
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 operates directly with the data: collections and their elements. Each tried to follow CRUD design whenever it’s possible or reasonable.
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: | |
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: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
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
{}
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: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
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 are required to start ticket sales on specific Event since they are defines the final price for them depending on various conditions.
GET
/v1/resources/deals/{iddeal}
¶Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
PATCH
/v1/resources/deals/{iddeal}
¶Updates a Deal.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/deals
¶Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
Response JSON Object: | |
|
|
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"
}
GET
/v1/resources/events/{idevent}
¶Returns information about the event.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
DELETE
/v1/resources/events/{idevent}
¶Removes an event.
Request Headers: | |
---|---|
|
|
Parameters: |
|
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
{}
GET
/v1/resources/events
¶Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/countries
¶Returns list of countries.
Request Headers: | |
---|---|
|
|
Response Headers: | |
|
|
Query Parameters: | |
|
|
Response JSON Array of Objects: | |
|
|
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"
}
]
GET
/v1/resources/cities
¶Returns list of cities.
Request Headers: | |
---|---|
|
|
Response Headers: | |
|
|
Query Parameters: | |
|
|
Response JSON Array of Objects: | |
|
|
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"
}
]
GET
/v1/resources/attachment/{idatt}
¶Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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"
}
GET
/v1/resources/attachments
¶Request Headers: | |
---|---|
|
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
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: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
Response JSON Object: | |
|
|
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"
}
GET
/v1/resources/orders/{idorder}
¶Returns information about specified order.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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.orgResponse:
HTTP/1.1 200 OK Connection: keep-alive Content-Length: 2 Content-Type: application/json; charset=UTF-8 Server: nginx {}
GET
/v1/resources/orders
¶Request Headers: | |
---|---|
|
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
Response JSON Object: | |
|
|
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
}
]
+----------+ +-------------+ +------+ +----------+
| executed | --> | in_progress | --> | done | --> | refunded |
+----------+ +-------------+ +------+ +----------+
| |
| |
v |
+----------+ |
| canceled | <-----+
+----------+
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.
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.
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"
}
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"
}
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"
}
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",
}
}
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: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
Collection of Partner objects.
GET
/v1/resources/partners
¶Returns list of Partner objects.
Request Headers: | |
---|---|
|
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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
}
}
]
GET
/v1/resources/events/{event_id}/promocodes/{promocode_id}
¶Returns information about the promocode
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
POST
/v1/resources/events/{event_id}/promocodes
¶Create promocode
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
PATCH
/v1/resources/events/{event_id}/promocodes/{promocode_id}
¶Edit promocode
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/events/{idevent}/sets/{idset}
¶Returns information about the set.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
PATCH
/v1/resources/events/{idevent}/sets/{idset}
¶Updates set information.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
DELETE
/v1/resources/events/{idevent}/sets/{idset}
¶Deletes a set.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Status Codes: |
|
GET
/v1/resources/events/{idevent}/sets
¶Returns list of existed sets
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
Status Codes: |
|
POST
/v1/resources/events/{idevent}/sets
¶Creates a new set.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/events/{idevent}/sets/{idset}/tickets/{idticket}
¶Returns information about the ticket.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/events/{idevent}/tickets
¶Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
GET
/v1/resources/events/{idevent}/tickets
¶Returns information about the all tickets in events.
Request Headers: | |
---|---|
|
|
Parameters: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
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: |
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: |
|
Query Parameters: | |
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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"
}
Collection of User objects.
GET
/v1/resources/users
¶Returns list of users.
Request Headers: | |
---|---|
|
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
Response JSON Object: | |
|
|
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: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: | |
|
|
Status Codes: |
|
Return list of orders objects.
GET
/v1/resources/venues/{idvenue}
¶Returns information about the venue.
Request Headers: | |
---|---|
|
|
Parameters: | |
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
PATCH
/v1/resources/venues/{idvenue}
¶Updates venue information.
Request Headers: | |
---|---|
|
|
Parameters: | |
Query Parameters: | |
|
|
Request JSON Object: | |
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
DELETE
/v1/resources/venues/{idvenue}
¶Deletes a venue.
Request Headers: | |
---|---|
|
|
Parameters: | |
Status Codes: |
|
GET
/v1/resources/venues
¶Request Headers: | |
---|---|
|
|
Parameters: | |
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
POST
/v1/resources/venues
¶Creates a new venue.
Request Headers: | |
---|---|
|
|
Parameters: | |
Query Parameters: | |
|
|
Request JSON Object: | |
Response Headers: | |
|
|
Response JSON Object: | |
|
|
Status Codes: |
|
Services are used to perform some operation upon specific objects.
GET
/v1/services/simple/events
¶Returns comprehensive information about available events.
Request Headers: | |
---|---|
|
|
Query Parameters: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
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: | |
|
|
Response Headers: | |
|
|
Response JSON Array of Objects: | |
|
|
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"
}
}
}
POST
/v1/services/whoami
¶Initiates user cookie session.
Request Headers: | |
---|---|
|
|
Request JSON Object: | |
|
|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: | |
---|---|
Response Headers: | |
|
|
Response JSON Object: | |
|
|
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: | |
---|---|
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
{}