{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-resources/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Using Postman","description":"Bookable is a TMS API gateway API — one integration to access real-time availability and manage bookings across venues on any table management system.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"using-postman","__idx":0},"children":["Using Postman"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Import any Bookable OpenAPI specification into Postman to explore endpoints, test requests, and prototype integrations without writing code first."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"available-specs","__idx":1},"children":["Available specs"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Spec"},"children":["Spec"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Download"},"children":["Download"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["TMS Gateway API"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://bookable.redocly.app/_spec/apis/OperatorApi.yml?download"},"children":["OperatorApi.yml"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bookings API"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://bookable.redocly.app/_spec/apis/BookingApi.yml?download"},"children":["BookingApi.yml"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Register Webhook Events"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://bookable.redocly.app/_spec/apis/WebhookApi.yml?download"},"children":["WebhookApi.yml"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Handling Webhook Events"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://bookable.redocly.app/_spec/apis/BookableWebhookApi.yaml?download"},"children":["BookableWebhookApi.yaml"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All specs follow the OpenAPI 3.0 format and can be imported into Postman individually or together."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"import-a-spec","__idx":2},"children":["Import a spec"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Postman"]}," and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Import"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ctrl+O"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["⌘+O"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose how you want to import:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["File"]}," — download the YAML file from the repository and upload it directly"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Link"]}," — paste the raw URL of the spec file"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},", then ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Import"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Postman will create a new collection with all endpoints, request bodies, and parameter schemas pre-populated."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Repeat for each spec you want to import. You can keep them as separate collections or merge them."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-collection-variables","__idx":3},"children":["Configure collection variables"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After importing, set up collection-level variables so every request shares the same base URL and credentials. These variables apply to any Bookable collection."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the collection name in the left panel."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Go to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Variables"]}," tab."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the following variables:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Initial value"},"children":["Initial value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api-sandbox.bookabletech.com"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Switch to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.bookabletech.com"]}," for production"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(your client_id)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["From the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.bookabletech.com"},"children":["Bookable Portal"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientSecret"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(your client_secret)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["From the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.bookabletech.com"},"children":["Bookable Portal"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accessToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(leave blank)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Populated automatically by the pre-request script"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a collection's requests use a hardcoded base URL after import, update them to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{baseUrl}}"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pre-request-script-for-automatic-token-refresh","__idx":4},"children":["Pre-request script for automatic token refresh"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add this script to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Pre-request Script"]}," tab of any Bookable collection. It automatically fetches and caches a token before every request, refreshing it when it is about to expire."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"// Bookable — auto token refresh pre-request script\n\nconst tokenUrl = pm.variables.get('baseUrl')\n  .replace('api-sandbox', 'auth-sandbox')\n  .replace('api.bookabletech', 'auth.bookabletech')\n  + '/oauth/token';\n\nconst tokenExpiresAt = pm.collectionVariables.get('tokenExpiresAt');\nconst accessToken = pm.collectionVariables.get('accessToken');\n\n// Reuse cached token if still valid (with 60s buffer)\nif (accessToken && tokenExpiresAt && Date.now() < parseInt(tokenExpiresAt) - 60000) {\n  return;\n}\n\npm.sendRequest(\n  {\n    url: tokenUrl,\n    method: 'POST',\n    header: { 'Content-Type': 'application/json' },\n    body: {\n      mode: 'raw',\n      raw: JSON.stringify({\n        grant_type: 'client_credentials',\n        client_id: pm.variables.get('clientId'),\n        client_secret: pm.variables.get('clientSecret'),\n        audience: 'api.bookabletech.com',\n      }),\n    },\n  },\n  (err, response) => {\n    if (err) { console.error('Token fetch error:', err); return; }\n    const body = response.json();\n    pm.collectionVariables.set('accessToken', body.access_token);\n    pm.collectionVariables.set('tokenExpiresAt', String(Date.now() + body.expires_in * 1000));\n  }\n);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The script derives the correct auth URL from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}," automatically, so it works for both sandbox and production without changes."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-the-authorization-header","__idx":5},"children":["Set up the Authorization header"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the collection name and go to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorization"]}," tab."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer Token"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Token"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{accessToken}}"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All requests in the collection inherit this setting. Individual requests can override it if needed."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"switching-between-sandbox-and-production","__idx":6},"children":["Switching between sandbox and production"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}," variable on the collection to switch environments. The pre-request script and auth URL update automatically."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"baseUrl"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sandbox"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api-sandbox.bookabletech.com"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Production"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.bookabletech.com"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related","__idx":7},"children":["Related"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/getting-started/auth"},"children":["Authentication"]}," — OAuth 2.0 token flow and code examples"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/production/bookingapi"},"children":["API Reference"]}," — OpenAPI specs"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/getting-started/quickstart"},"children":["Quickstart"]}," — make your first booking"]}]}]},"headings":[{"value":"Using Postman","id":"using-postman","depth":1},{"value":"Available specs","id":"available-specs","depth":2},{"value":"Import a spec","id":"import-a-spec","depth":2},{"value":"Configure collection variables","id":"configure-collection-variables","depth":2},{"value":"Pre-request script for automatic token refresh","id":"pre-request-script-for-automatic-token-refresh","depth":2},{"value":"Set up the Authorization header","id":"set-up-the-authorization-header","depth":2},{"value":"Switching between sandbox and production","id":"switching-between-sandbox-and-production","depth":2},{"value":"Related","id":"related","depth":2}],"frontmatter":{"seo":{"title":"Using Postman"}},"lastModified":"2026-03-04T17:44:48.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/resources/postman-import","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}