Tickets Module
The Octopus platform API methods referring to the Tickets module are described below. These methods let you, for example to obtain all issued tickets or generate a new one.
Services
GET - Get Services of Location
Returns the different validation methods or services defined in the Location indicated by the LocationId parameter.
https://<server-domainname>/rest/<version>/Location/{LocationId}/services |
Parameters
TYPE | Parameter | Significance | Type | Required | Default |
---|---|---|---|---|---|
HEAD | Authorization | Bearer <API_KEY> | String | YES | |
GET | LocationId | Location identifier | String | YES |
Response
HTTP CODE | Result | Response data |
---|---|---|
200 | Ok | {
"data": [
{
"id": 59219,
"LocationId": "28XXX004",
"typeId": "ttf",
"name": "Ticket - 1 Hora",
"price": 0,
"status": 1,
"onlineTime": 0,
"expTime": 3600,
"tpv": 0,
"pms": 0,
"showLogin": 1,
"simDevices": 10,
"maxUsers": 1,
"loginMethod": "general",
"download": 0,
"upload": 0,
"downrate": 0,
"uprate": 0,
"dailyLimit": 0,
"validUntil": 15552000,
"vip": 0,
"validateEmail": 0,
"deleted": 0,
"withRegistration": 0,
"macCaching": 0,
"issueOrder": 0,
"type": {
"id": "ttf",
"description": "Tiempo corrido",
"timetofinish": true,
"onlinetime": false,
"timetolimit": false,
"limittraffic": false
}
}
],
"pagination": {
"offset": 0,
"limit": 5000,
"rows": 9,
"pages": 1,
"currentPage": 1
}
}
|
401 | Unauthorized | Explanation of the error |
The identifier or ID of each service must be sent as a parameter to create new tickets, as detailed in the following method. |
Tickets
POST - Create a Ticket
Create a ticket for the Location indicated by the LocationId parameter. You must also indicate the service on which you want to create the Ticket. The service ID can be obtained using the method described above. The other parameters depend on the type of service selected, which must be indicated by the service parameter
.
https://<server-domainname>/rest/<version>/Location/{LocationId}/tickets |
Parameters
TYPE | Parameter | Significance | Type | Required | Default |
---|---|---|---|---|---|
HEAD | Authorization | Bearer <API_KEY> | String | YES | |
GET | LocationId | Location identifier | String | YES | |
POST | start_time | date (ISO-8601) | Current date | ||
POST | valid_until | date (ISO-8601) | Current date | ||
POST | format | String (print, email) | |||
POST | service | Service identifier | String(16) | YES | |
POST | userId | User identifier | String(64) | ||
POST | numusers | Number of simultaneous users | integer |
Response
HTTP CODE | Result | Response data |
---|---|---|
200 | Ok | |
401 | Unauthorized | Explanation of the error |
a
GET - Get Tickets of Location
Returns all the tickets that have been issued in the Location indicated by the LocationId parameter.
Parameters
TYPE | Parameter | Significance | Type | Required | Default |
---|---|---|---|---|---|
HEAD | Authorization | Bearer <API_KEY> | String | YES | |
GET | LocationId | Location identifier | String | YES |
Response
HTTP CODE | Result | Response data |
---|---|---|
200 | Ok | |
401 | Unauthorized | Explanation of the error |