# /getAvailability

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

This functionality allow you to get the availability of a specified period.
Some clients allow to make a reservation for a day, others require you to also select a time (for example het Van Gogh Museum). This depends on what availability type is set within the system for this client.

**HMAC calculation**
Base64 encode - SHA256 (apiKey + endDate + environment + showTicketsAllocation + startDate + userId)

* Sort the sign data alphabetical ascending, you can also find the sequence on the concerned API specification page.

**Please note**
There are three types of availability:

* Timeslots
* Date
* Period

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Global Reseller",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://globalreseller.nl/webservices/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/getAvailability": {
      "post": {
        "summary": "/getAvailability",
        "description": "",
        "operationId": "getavailability",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apiKey",
                  "environment",
                  "userId",
                  "startDate",
                  "endDate",
                  "showTicketsAllocation",
                  "HMACKey"
                ],
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "description": "Your public apiKey needs to be included in every request."
                  },
                  "environment": {
                    "type": "string",
                    "description": "\"test\" or \"production\"",
                    "enum": [
                      "test",
                      "production"
                    ]
                  },
                  "userId": {
                    "type": "integer",
                    "description": "The userId is a reference to the user (museum / attraction). The userId can be requested via getAvailableUsers and can be cached in your application.",
                    "format": "int32"
                  },
                  "startDate": {
                    "type": "string",
                    "description": "Date format: yyyy-mm-dd.",
                    "format": "date"
                  },
                  "endDate": {
                    "type": "string",
                    "description": "Date format: yyyy-mm-dd.",
                    "format": "date"
                  },
                  "showTicketsAllocation": {
                    "type": "integer",
                    "description": "When set to 1 the response will include the amount of available tickets instead of a boolean.",
                    "format": "int32"
                  },
                  "HMACKey": {
                    "type": "string",
                    "description": "The HMACKey is calculated based on the input fields."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "\n{\n    \"success\": true,\n    \"availability\": [\n        \"2018-05-16\"\n    ],\n    \"availabilityType\": \"date\"\n}\t\n "
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "availability": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "2018-05-16"
                      }
                    },
                    "availabilityType": {
                      "type": "string",
                      "example": "date"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Cache-Control",
        "value": "no-cache"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62b068c7795387013326be5c:62b1a6ce14d9f5002141aa53"
}
```