Add Guest Pass user
Purpose: Use this API to add a new Guest Pass user.
You must specify user_id and the body parameters as mentioned in the BODY PARAMS section.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
POST /v1/guests/{user_id}/guestpass
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | Unique identifier of the user. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| instrument_id | string | Yes | Unique identifier of the transferring benefit item. |
| instrument_type | string | Yes | Type of the item for transferring benefit |
| credit_type | string | Yes | Type of the Guest Pass credit. |
| user_id | string | No | (optional) Unique identifier of the user |
| first_name | string | No | First name of the guest |
| last_name | string | No | Last name of the guest. |
| string | No | Email address of the guest. | |
| mobile | string | No | Mobile number of the guest. |
Response
Success (201 Created)
{}
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/guests/{user_id}/guestpass' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"instrument_id": "string",
"instrument_type": "string",
"credit_type": "string",
"user_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"mobile": "string"
}'
const response = await fetch('https://api.zenoti.com/v1/guests/{user_id}/guestpass', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
instrument_id: 'string',
instrument_type: 'string',
credit_type: 'string',
user_id: 'string',
first_name: 'string',
last_name: 'string',
email: 'string',
mobile: 'string'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/guests/{user_id}/guestpass',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'instrument_id': 'string', 'instrument_type': 'string', 'credit_type': 'string', 'user_id': 'string', 'first_name': 'string', 'last_name': 'string', 'email': 'string', 'mobile': 'string'}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new {
instrument_id = "string",
instrument_type = "string",
credit_type = "string",
user_id = "string",
first_name = "string",
last_name = "string",
email = "string",
mobile = "string"
}),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/guests/{user_id}/guestpass", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/guests/{user_id}/guestpass')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { instrument_id: 'string', instrument_type: 'string', credit_type: 'string', user_id: 'string', first_name: 'string', last_name: 'string', email: 'string', mobile: 'string' }.to_json
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |