# /getAvailability

[block:api-header]
{
  "title": "Description:"
}
[/block]

With this functionality you can retrieve the availability of a specified article (ticket type).

**note**
This function only returns tickettypes that have been made available for sale through API.

**HMAC calculation:**
Base64 encode - SHA256(apiKey + ticketTypeId + ticketDate\*)

* only include ticketDate in the HMAC if you are using this param.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Scan API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://globalticket.com/webservices/scanapi"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/getAvailability": {
      "post": {
        "summary": "/getAvailability",
        "description": "",
        "operationId": "getavailability-1",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "apiKey",
                  "HMACKey",
                  "ticketTypeId"
                ],
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "description": "Your public apiKey needs to be included in every request"
                  },
                  "HMACKey": {
                    "type": "string",
                    "description": "The HMACKey is calculated based on the input fields"
                  },
                  "ticketTypeId": {
                    "type": "integer",
                    "description": "Unique identifier for a particular tickettype",
                    "format": "int32"
                  },
                  "ticketDate": {
                    "type": "string",
                    "description": "This param is optional, default value is the current date.",
                    "default": "YYYY-MM-DD",
                    "format": "date"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": true,\n\t\"availibilityType\": \"text\",\n\t\"availableTickets\": 1,\n\t\"numberOfTicketTypes\": 1,\n\t\"timeslots\": [{\n\t\t\"time\": \"16:00\",\n\t\t\"tickets\": 1\n\t}]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "availibilityType": {
                      "type": "string",
                      "example": "text"
                    },
                    "availableTickets": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "numberOfTicketTypes": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "timeslots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string",
                            "example": "16:00"
                          },
                          "tickets": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\":false,\n\t\"errorMessage\":\"No tickets available.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "No tickets available."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62b1d31f161f1601e7ec3d31:62b1dda43072be00705a9781"
}
```