Skip to content

Get Host's access token from Roomorama

Keang edited this page Nov 14, 2016 · 2 revisions

Background

Before creating a host entry on Concierge, we need to get the access token from Roomorama.

For now, this is a separate POST request to Roomorama. Later, we should combine this into one process when we have a unified admin dashboard (Bridge Admin)

Request to Roomorama

curl -H 'Content-Type: application/json' -H 'Authorization: BEARER {TOKEN}' --data-binary @host_params.json https://{HOST}/v1.0/create-host

Parameters

  • Use TOKEN and HOST from this meldium entry.
  • host_params.json is in the current directory, something like:
# ./host_params.json
{
  "supplier": "SAW",
  "host": {
    "username": "supplier_saw",
    "name":     "Supplier SAW",
    "email":    "developers+sandbox_supplier_saw@roomorama.com",
    "phone":    "98765432"
  },
  "webhooks": {
    "quote": {
      "production": "https://concierge-sandbox.roomorama.com/saw/quote",
      "test":       "https://concierge-sandbox.roomorama.com/saw/quote"
    },
    "checkout": {
      "production": "https://concierge-sandbox.roomorama.com/saw/checkout"
    },
    "booking": {
      "production": "https://concierge-sandbox.roomorama.com/saw/booking",
      "test": "https://concierge-sandbox.roomorama.com/saw/booking"
    },
    "cancellation": {
      "production": "https://concierge-sandbox.roomorama.com/saw/cancel",
      "test":       "https://concierge-sandbox.roomorama.com/saw/cancel"
    }
  }
}
  • The production and test webhook links for each environments:
# Staging:
      "production": "https://concierge-staging.roomorama.com/{SUPPLIER_NAME}/{ACTION}",
      "test":       "https://concierge-staging.roomorama.com/{SUPPLIER_NAME}/{ACTION}"

# Sandbox:
      "production": "https://concierge-sandbox.roomorama.com/{SUPPLIER_NAME}/{ACTION}",
      "test":       "https://concierge-sandbox.roomorama.com/{SUPPLIER_NAME}/{ACTION}"

# Produciton:
      "production": "https://concierge.roomorama.com/{SUPPLIER_NAME}/{ACTION}",
      "test":       "https://concierge-sandbox.roomorama.com/{SUPPLIER_NAME}/{ACTION}"
  • See concierge routes for all SUPPLIER_NAME and ACTION.

Response

{"status":"success","access_token":"1umMJPB7H38IxFelKSDzqjgVcWZ7CYBuMyXUzwboro"}

With that we can use the access_token to create a host on concierge (click button from a supplier page).