### Example Data30 Invite Object Source: https://developers.envoy.com/hub/reference/retrieve-entry-by-id Provides an example of a 'Data30' object, showcasing a sample visitor invite. This example includes realistic values for visitor details, arrival information, and associated flow data. ```json { "id": 4630502, "type": "invites", "attributes": { "full-name": "API Test", "email": "api+test@envoy.com", "inviter-name": "API Test Host", "expected-arrival-time": "2019-03-24T21:15:00Z", "private-notes": "", "arrived": false, "been-here-before": true, "flow-name": "Visitor", "flow-id": 63213, "user-data": [ { "field": "Your Full Name", "value": "" }, { "field": "Host", "value": "API Test Host" }, { "field": "Your Email Address", "value": "" }, { "field": "Purpose of visit", "value": "Visitor" } ], "additional-guests": 0, "guest-updated-at": null, "nda": null, "nda-available": true, "original-nda-sign-date": null, "secret-token": "3aeacf3b3c732f7fc755", "approval-status": null }, "relationships": { "$ref": "#/components/schemas/Relationships10" } } ``` -------------------------------- ### Invite Data Example Source: https://developers.envoy.com/hub/reference/retrieve-entries This snippet illustrates an example of invite data, detailing visitor information, host, expected arrival, and associated flow details. It's useful for creating and managing visitor invitations through the API. ```json { "data": { "id": 4630502, "type": "invites", "attributes": { "full-name": "API Test", "email": "api+test@envoy.com", "inviter-name": "API Test Host", "expected-arrival-time": "2019-03-24T21:15:00Z", "private-notes": "", "arrived": false, "been-here-before": true, "flow-name": "Visitor", "flow-id": 63213, "user-data": [ { "field": "Your Full Name", "value": "" }, { "field": "Host", "value": "API Test Host" }, { "field": "Your Email Address", "value": "" }, { "field": "Purpose of visit", "value": "Visitor" } ], "additional-guests": 0, "guest-updated-at": null, "nda": null, "nda-available": true, "original-nda-sign-date": null, "secret-token": "3aeacf3b3c732f7fc755", "approval-status": null }, "relationships": { "entry": { "data": null }, "location": { "data": { "id": 46424, "type": "locations" } }, "flow": { "data": { "type": "flows", "id": 63213 } }, "employee": { "data": { "type": "employees", "id": 8948461 } }, "creator": { "data": { } } } } } ``` -------------------------------- ### Fetch Blocklist Entries (Ruby) Source: https://developers.envoy.com/hub/reference/blocklists-6 Illustrates how to fetch blocklist entries using Ruby. This example uses the `net/http` library to perform a GET request to the `/v1/blocklists` endpoint, ensuring the `accept` header is set to `application/json`. ```ruby require 'uri' require 'net/http' uri = URI.parse('https://api.envoy.com/v1/blocklists') Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' response = http.request(request) puts response.body end ``` -------------------------------- ### Example API Response for Getting Desks Source: https://developers.envoy.com/hub/reference/desks-2 This JSON represents a typical response from the 'Get desks' API endpoint. It contains a 'data' array, where each element is a desk object conforming to the structure described previously. The 'meta' object within the response can include optional 'relationships' and 'messages' for enriched data retrieval. ```json { "data": [ { "id": "string", "name": "string", "type": "DESK", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "isAvailable": true, "assignedTo": "string", "locationId": "string", "floorId": "string", "floorName": "string", "neighborhoodId": "string", "neighborhoodName": "string", "xPos": "float", "ypos": "float" } ], "meta": { "relationships": [ "string" ], "messages": [ "string" ] } } ``` -------------------------------- ### Fetch Blocklist Entries (Python) Source: https://developers.envoy.com/hub/reference/blocklists-6 Shows how to retrieve blocklist entries using Python's `requests` library. This example makes a GET request to the `/v1/blocklists` endpoint and includes the `accept: application/json` header. ```python import requests url = "https://api.envoy.com/v1/blocklists" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### User Data Item Example Source: https://developers.envoy.com/hub/reference/retrieve-invite This snippet provides an example of a single 'user-data' item, specifying a 'field' and its corresponding 'value'. This is used within larger data structures to capture custom user information. ```json { "field": "Your Full Name", "value": "" } ``` -------------------------------- ### Example Custom Fields Payload Source: https://developers.envoy.com/hub/reference/recurringinvite An example of how to structure the 'customFields' array for a new invite, pre-populating answers to specific questions. The 'Purpose of visit' field must be included with a corresponding answer. ```json {"Purpose of visit": "Interviewer"} ``` -------------------------------- ### Get an Entry by ID using PHP Source: https://developers.envoy.com/hub/reference/entries-1 This PHP example shows how to get an entry by its ID using cURL. It constructs the API request URL, sets the necessary headers, and executes the request. The response is then decoded from JSON, and either the data or an error message is displayed. This code assumes you have cURL enabled in your PHP installation. ```php = 200 && $http_status < 300) { $data = json_decode($response, true); if (json_last_error() === JSON_ERROR_NONE) { echo 'Entry data:
' . print_r($data, true) . '
'; } else { echo 'Error decoding JSON: ' . json_last_error_msg(); } } else { echo "Error fetching entry: HTTP Status {$http_status}"; echo '
' . $response . '
'; } } c url_close($ch); ?> ``` -------------------------------- ### Fetch Flows using PHP Source: https://developers.envoy.com/hub/reference/flows-2 This PHP example illustrates how to fetch a list of flows from the Envoy API using cURL. It sets the appropriate cURL options for a GET request, including the `accept` header. The response is then decoded from JSON format. Ensure the cURL extension is enabled in your PHP installation. ```php ``` -------------------------------- ### GET /websites/developers_envoy_hub_reference Source: https://developers.envoy.com/hub/reference/desks-2 Retrieves a list of desks with options for pagination and filtering. ```APIDOC ## GET /websites/developers_envoy_hub_reference ### Description Retrieves a list of desks. This endpoint supports pagination using `page` and `perPage` query parameters. ### Method GET ### Endpoint /websites/developers_envoy_hub_reference ### Parameters #### Query Parameters - **page** (number) - Optional - Controls which page is returned in the results. Use with perPage. - **perPage** (number) - Optional - Controls how many results to show in each page of the results. Use with page. Default: 250. Must be greater than 0. ### Request Example ```json { "example": "Not applicable for GET requests without a body." } ``` ### Response #### Success Response (200) - **data** (array) - An array of desk objects. - **id** (string) - The unique identifier of the desk. - **name** (string) - The name of the desk. - **createdAt** (string) - The date and time (ISO 8601 format) when the desk was created. - **updatedAt** (string) - The date and time (ISO 8601 format) when the desk was last updated. - **isAvailable** (boolean) - Denotes whether the desk is currently occupied or free. #### Response Example ```json { "data": [ { "id": "desk_123", "name": "Conference Room A", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z", "isAvailable": true } ] } ``` ``` -------------------------------- ### Get an Entry by ID using Python Source: https://developers.envoy.com/hub/reference/entries-1 This Python script utilizes the 'requests' library to fetch an entry by its ID from the Envoy API. It constructs the URL, sends a GET request with the appropriate header, and processes the JSON response. Remember to install the 'requests' library (`pip install requests`). ```python import requests def get_entry_by_id(entry_id): url = f"https://api.envoy.com/v1/entries/{entry_id}" headers = { "accept": "application/json" } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx) data = response.json() print(f"Entry data: {data}") return data except requests.exceptions.RequestException as e: print(f"Error fetching entry: {e}") return None # Example usage: # entry_data = get_entry_by_id('your_entry_id') ``` -------------------------------- ### Example Entry Data Structure Source: https://developers.envoy.com/hub/reference/httpsappenvoycomavisitorsapiv2entries This snippet shows the structure of an entry in the Envoy Hub, including attributes like full name, email, private notes, and finalized timestamp. It also details relationships to locations and users. ```json { "data": { "attributes": { "full-name": "Nicole Jacinto", "email": "nicole.j@adomain.tld", "private-notes": "This private note is optional and not visible to your visitor", "print-badge": false, "send-host-notification": false, "current-location-id": 46424, "flow-name": "Visitor", "locality": { "place-id": "" }, "user-data": { "Purpose of visit": "Visitor", "Your Email Address": "nicole.j@adomain.tld", "Host": "Stephen Arsenault", "Your Full Name": "Nicole Jacinto" }, "finalized-at": "2019-07-17T10:52:00Z" }, "relationships": { "location": { "data": { "type": "locations", "id": 46424 } }, "sign-in-user": { "data": { "type": "users", "id": 308602 } } }, "type": "entries" } } ``` -------------------------------- ### Get an Entry by ID using Ruby Source: https://developers.envoy.com/hub/reference/entries-1 This Ruby code snippet illustrates how to retrieve an entry by its ID using the 'httparty' gem. It sends a GET request to the Envoy API and prints the JSON response or any encountered errors. Make sure to install 'httparty' (`gem install httparty`). ```ruby require 'httparty' url = "https://api.envoy.com/v1/entries/your_entry_id" response = HTTParty.get(url, headers: { 'accept' => 'application/json' }) if response.success? puts "Entry data: #{response.parsed_response}" else puts "Error fetching entry: #{response.code} - #{response.message}" end ``` -------------------------------- ### Integration Patterns and Use Cases Source: https://context7.com/context7/developers_envoy_hub_reference/llms.txt Explains various integration scenarios for the Envoy API, including visitor management, space management, and HR system integrations. ```APIDOC ## Integration Patterns and Use Cases ### Description This section details how the Envoy API can be integrated into different systems and workflows, providing examples for common use cases. ### Visitor Management Automate pre-registration, send QR codes, and trigger sign-in notifications by integrating with calendar systems. ### Space Management Build custom booking interfaces, integrate with ERP systems, and generate occupancy reports using the reservations and desks endpoints. Filter by neighborhoods and floors for zone-based policies. ### HR System Integration Synchronize employee directory information and manage location access permissions via the employees endpoint. ### General Integration Best Practices - Implement proper error handling for rate limits (HTTP 429). - Handle pagination for large datasets using `page` and `perPage` parameters. - Store refresh tokens securely when using OAuth2 flows. - The API uses a consistent RESTful design with JSON responses, making it compatible with modern web frameworks, mobile applications, and serverless architectures. ``` -------------------------------- ### Envoy API Overview Source: https://developers.envoy.com/hub/reference/index General information about the Envoy API, including its architecture and basic usage patterns. ```APIDOC ## Envoy API Overview ### Description The Envoy API is REST-based. It accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. ### Getting Started Refer to the [quickstart guide](link-to-quickstart) to learn how to use the Envoy API. ### Request Body Format Form-encoded ### Response Body Format JSON ``` -------------------------------- ### Get an Entry by ID using Node.js Source: https://developers.envoy.com/hub/reference/entries-1 This Node.js snippet shows how to fetch an entry by its ID using the 'axios' library. It makes a GET request to the Envoy API endpoint and handles the response, logging the data or any errors encountered. Ensure 'axios' is installed (`npm install axios`). ```javascript const axios = require('axios'); const getEntryById = async (entryId) => { try { const response = await axios.get(`https://api.envoy.com/v1/entries/${entryId}`, { headers: { 'accept': 'application/json' } }); console.log('Entry data:', response.data); return response.data; } catch (error) { console.error('Error fetching entry:', error); throw error; } }; // Example usage: // getEntryById('your_entry_id'); ``` -------------------------------- ### Get Company - Node.js Request Source: https://developers.envoy.com/hub/reference/companies This Node.js example shows how to fetch company information from the Envoy API. It utilizes the 'node-fetch' library to make a GET request to the companies endpoint and expects a JSON response. ```javascript const fetch = require('node-fetch'); const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://api.envoy.com/rest/v1/companies', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Desk Object Documentation Source: https://developers.envoy.com/hub/reference/updatedesk Documentation for the Desk object, including its properties and their descriptions. ```APIDOC ## Desk Object ### Description Represents a desk within a workspace, including its position and associated neighborhood. ### Properties - **neighborhoodId** (string) - The unique identifier of the zone or collection of spaces / neighborhoods that the space belongs to. - **neighborhoodName** (string) - A short descriptor of the neighborhood that the space belongs to. - **xPos** (number) - The x coordinate position the desk is placed on the Map. - **yPos** (number) - The y coordinate the desk is placed on the Map. ``` -------------------------------- ### Get Company - PHP Request Source: https://developers.envoy.com/hub/reference/companies This PHP example illustrates how to make a GET request to the Envoy API's companies endpoint using cURL. It sets the accept header to application/json and outputs the response body. ```php ``` -------------------------------- ### POST /invites Source: https://developers.envoy.com/hub/reference/retrieve-entries Creates a new invite for a visitor or employee, capturing details like name, expected arrival time, and host information. ```APIDOC ## POST /invites ### Description Creates a new invite for a visitor or employee, capturing details like name, expected arrival time, and host information. ### Method POST ### Endpoint /invites ### Parameters #### Request Body - **data** (object) - Required - The payload for creating the invite. - **type** (string) - Required - The resource type, always 'invites'. - **attributes** (object) - Required - Contains the details of the invite. - **full-name** (string) - Required - The full name of the invitee. - **email** (string) - Required - The email address of the invitee. - **inviter-name** (string) - Required - The name of the host inviting the person. - **expected-arrival-time** (string) - Optional - The expected arrival time in ISO 8601 format. - **private-notes** (string) - Optional - Private notes for the invite. - **arrived** (boolean) - Optional - Indicates if the invitee has arrived. - **been-here-before** (boolean) - Optional - Indicates if the invitee has been here before. - **flow-name** (string) - Optional - The name of the flow associated with the invite. - **flow-id** (integer) - Optional - The ID of the flow associated with the invite. - **user-data** (array) - Optional - Custom user data fields. - **additional-guests** (integer) - Optional - Number of additional guests. - **nda** (null) - Placeholder for NDA information. - **nda-available** (boolean) - Indicates if an NDA is available. - **original-nda-sign-date** (null) - Placeholder for the original NDA sign date. - **secret-token** (string) - A secret token for the invite. - **approval-status** (null) - Placeholder for approval status. - **relationships** (object) - Optional - Relationships to other resources. - **location** (object) - Data for the location of the invite. - **id** (integer) - Required - The ID of the location. - **type** (string) - Required - The resource type, always 'locations'. - **flow** (object) - Data for the flow associated with the invite. - **id** (integer) - Required - The ID of the flow. - **type** (string) - Required - The resource type, always 'flows'. - **employee** (object) - Data for the employee associated with the invite. - **id** (integer) - Required - The ID of the employee. - **type** (string) - Required - The resource type, always 'employees'. ### Request Example ```json { "data": { "type": "invites", "attributes": { "full-name": "API Test", "email": "api+test@envoy.com", "inviter-name": "API Test Host", "expected-arrival-time": "2019-03-24T21:15:00Z", "private-notes": "", "arrived": false, "been-here-before": true, "flow-name": "Visitor", "flow-id": 63213, "user-data": [ { "field": "Your Full Name", "value": "" }, { "field": "Host", "value": "API Test Host" }, { "field": "Your Email Address", "value": "" }, { "field": "Purpose of visit", "value": "Visitor" } ], "additional-guests": 0, "nda": null, "nda-available": true, "original-nda-sign-date": null, "secret-token": "3aeacf3b3c732f7fc755", "approval-status": null }, "relationships": { "entry": { "data": null }, "location": { "data": { "id": 46424, "type": "locations" } }, "flow": { "data": { "type": "flows", "id": 63213 } }, "employee": { "data": { "type": "employees", "id": 8948461 } }, "creator": { "data": { "type": "users", "id": 308602 } } } } } ``` ### Response #### Success Response (200) - **data** (object) - The created invite object. - **id** (integer) - The unique identifier of the invite. - **type** (string) - The resource type, always 'invites'. - **attributes** (object) - Details of the invite (same as request body attributes). - **relationships** (object) - Relationships to other resources (same as request body relationships). #### Response Example ```json { "data": { "id": 4630502, "type": "invites", "attributes": { "full-name": "API Test", "email": "api+test@envoy.com", "inviter-name": "API Test Host", "expected-arrival-time": "2019-03-24T21:15:00Z", "private-notes": "", "arrived": false, "been-here-before": true, "flow-name": "Visitor", "flow-id": 63213, "user-data": [ { "field": "Your Full Name", "value": "" }, { "field": "Host", "value": "API Test Host" }, { "field": "Your Email Address", "value": "" }, { "field": "Purpose of visit", "value": "Visitor" } ], "additional-guests": 0, "nda": null, "nda-available": true, "original-nda-sign-date": null, "secret-token": "3aeacf3b3c732f7fc755", "approval-status": null }, "relationships": { "entry": { "data": null }, "location": { "data": { "id": 46424, "type": "locations" } }, "flow": { "data": { "type": "flows", "id": 63213 } }, "employee": { "data": { "type": "employees", "id": 8948461 } }, "creator": { "data": { "type": "users", "id": 308602 } } } } } ``` ``` -------------------------------- ### GET /v1/desks Source: https://developers.envoy.com/hub/reference/desks Retrieves a list of desks, with options for pagination. ```APIDOC ## GET /v1/desks ### Description Retrieves a list of desks. Supports pagination through `page` and `perPage` query parameters. ### Method GET ### Endpoint /v1/desks ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **perPage** (integer) - Optional - The number of items to return per page. ### Request Example ```json { "example": "curl --request GET \\ --url 'https://api.envoy.com/v1/desks?page=1&perPage=250' \\ --header 'accept: application/json'" } ``` ### Response #### Success Response (200) - **data** (array of objects) - A list of desk objects. - **id** (string) - The unique identifier for the desk. - **name** (string) - The name of the desk. - **createdAt** (date-time) - The date and time the desk was created. - **updatedAt** (date-time) - The date and time the desk was last updated. - **isAvailable** (boolean) - Indicates if the desk is currently available. - **assignedTo** (string) - The name of the person assigned to the desk, if any. - **locationId** (string) - The ID of the location the desk belongs to. - **floorId** (string) - The ID of the floor the desk is on. - **floorName** (string) - The name of the floor the desk is on. - **neighborhoodId** (string) - The ID of the neighborhood the desk belongs to. - **neighborhoodName** (string) - The name of the neighborhood the desk belongs to. - **xPos** (number) - The X coordinate of the desk on the floor plan. - **yPos** (number) - The Y coordinate of the desk on the floor plan. - **relationships** (array of strings) - Optional relationships to load. - **messages** (array of strings) - Optional scope information. #### Response Example ```json { "data": [ { "id": "desk_abc123", "name": "Desk 1", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z", "isAvailable": true, "assignedTo": null, "locationId": "loc_xyz789", "floorId": "floor_def456", "floorName": "Floor 1", "neighborhoodId": "neigh_ghi321", "neighborhoodName": "Area A", "xPos": 10.5, "yPos": 20.2, "relationships": [], "messages": [] } ] } ``` ``` -------------------------------- ### Fetch Flows using Python Source: https://developers.envoy.com/hub/reference/flows-2 This Python script uses the `requests` library to fetch a list of flows from the Envoy API. It constructs the URL with query parameters and sends a GET request. The response is then printed as JSON. Make sure to install the `requests` library (`pip install requests`). ```python import requests url = "https://api.envoy.com/v1/flows?page=1&perPage=50" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Fetch Flows using Node.js Source: https://developers.envoy.com/hub/reference/flows-2 This Node.js snippet shows how to retrieve a list of flows using the Envoy API. It utilizes the 'node-fetch' library to make an HTTP GET request to the specified endpoint. The query parameters can be adjusted to filter and paginate the results. Ensure you have the 'node-fetch' package installed (`npm install node-fetch`). ```javascript import fetch from 'node-fetch'; const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://api.envoy.com/v1/flows?page=1&perPage=50', options) .then(response => response.json()) .then(response => console.log(response)) .catch(error => console.error(error)); ``` -------------------------------- ### Servers Source: https://developers.envoy.com/hub/reference/invite Lists the base URLs for the Envoy Hub API. ```APIDOC ## Servers ### Description Provides the base URLs for accessing the Envoy Hub API. ### Method N/A (Server Definition) ### Endpoint N/A (Server Definition) ### Parameters N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Available Servers: * **Production:** `https://api.envoy.com` ``` -------------------------------- ### POST /v1/desks Source: https://developers.envoy.com/hub/reference/createdesk This endpoint allows you to create a new desk within a location. You must provide the location ID, floor ID, and name for the desk. Optional fields include neighborhood ID, assigned employee, enablement status, and x/y coordinates. ```APIDOC ## POST /v1/desks ### Description Create a desk. ### Method POST ### Endpoint /v1/desks ### Parameters #### Request Body - **desk** (object) - Required - - **locationId** (string) - Required - The id of the location where you would like to create the desk. - **floorId** (string) - Required - The id of the floor where you would like to create the desk. - **name** (string) - Required - The name you would like to assign to the desk. - **neighborhoodId** (string) - Optional - If you would like to assign this desk to a specific neighborhood, please provide that neighborhoods id here. - **assignedTo** (string) - Optional - If you would like to assign this desk to a specific employee, please provide that employees email here. - **enabled** (boolean) - Optional - If you would like the desk enabled/disabled for booking after creating it. - **xPos** (number) - Optional - The normalized x coordinate position the desk is placed on the Map. This must be a decimal value between 0 and 1. - **yPos** (number) - Optional - The normalized y coordinate position the desk is placed on the Map. This must be a decimal value between 0 and 1. ### Request Example ```json { "desk": { "locationId": "loc_123", "floorId": "floor_abc", "name": "Desk 1", "neighborhoodId": "neigh_xyz", "assignedTo": "user@example.com", "enabled": true, "xPos": 0.5, "yPos": 0.75 } } ``` ### Response #### Success Response (200) - **data** (object) - - **id** (string) - The unique identifier of the desk. - **name** (string) - The name of the desk. #### Response Example ```json { "data": { "id": "desk_guid_123", "name": "Desk 1" } } ``` ``` -------------------------------- ### Retrieve Entry by ID using cURL Source: https://developers.envoy.com/hub/reference/entries Demonstrates how to retrieve a specific entry by its ID using a cURL request. This example highlights the necessary URL and headers for the GET request. ```shell curl --request GET \ --url https://app.envoy.com/a/visitors/api/v2/entries/entry-id \ --header 'accept: application/vnd.api+json' ``` -------------------------------- ### Retrieve Flows using cURL Source: https://developers.envoy.com/hub/reference/flows Demonstrates how to retrieve a list of flows using a cURL request. This example shows the necessary URL and headers for making the GET request to the deprecated endpoint. ```shell curl --request GET \ --url https://app.envoy.com/a/visitors/api/v3/flows \ --header 'accept: application/vnd.api+json' ``` -------------------------------- ### Get a Space using PHP Source: https://developers.envoy.com/hub/reference/spaces This PHP example shows how to fetch space details using cURL or another HTTP client. It sets the request URL with the space ID and includes the 'accept: application/json' header for the response. ```php // PHP example (using cURL) // $spaceId = 'your_space_id'; // $url = "https://api.envoy.com/v1/spaces/{$spaceId}"; // // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json')); // // $response = curl_exec($ch); // if (curl_errno($ch)) { // echo 'Error:' . curl_error($ch); // } // curl_close($ch); // echo $response; ``` -------------------------------- ### Servers Source: https://developers.envoy.com/hub/reference/createinvite The base URL for the Envoy API. ```APIDOC ## Servers - **URL**: `https://api.envoy.com` ``` -------------------------------- ### Server Information Source: https://developers.envoy.com/hub/reference/createworkschedule Details about the base URL for the Envoy Hub Reference API. ```APIDOC ## Server Information ### Description Provides the base URL for accessing the Envoy Hub Reference API. ### Method N/A (Describes server configuration) ### Endpoint N/A ### Parameters #### Servers - **url** (string) - The base URL for the API. - **url**: https://api.envoy.com - **description**: "" ### Request Example N/A ### Response N/A ``` -------------------------------- ### POST /v1/entries Source: https://developers.envoy.com/hub/reference/createentry Creates a new entry for a visitor or employee. Requires location and flow details, along with the visitor's full name. ```APIDOC ## POST /v1/entries ### Description Creates a new entry for a visitor or employee. This endpoint allows for the creation of entries with details such as location, flow, full name, email, photo, and custom fields. ### Method POST ### Endpoint /v1/entries ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **entry** (object) - Required - Details of the entry to create. - **locationId** (string) - Required - The ID of the location for the entry. - **flowId** (string) - Required - The ID of the sign-in flow to use. - **fullName** (string) - Required - The full name associated with the entry. - **email** (string) - Optional - The email address associated with the entry. - **photoBase64** (string) - Optional - Base64 encoded photo data for the entry. - **customFields** (array) - Optional - An array of custom fields for the entry. - **field** (string) - Required - The name of the custom sign-in field. - **value** (string) - Required - The value for the custom field. ### Request Example ```json { "entry": { "locationId": "loc_123", "flowId": "flow_abc", "fullName": "Jane Doe", "email": "jane.doe@example.com", "customFields": [ { "field": "Purpose of Visit", "value": "Meeting with John Smith" } ] } } ``` ### Response #### Success Response (200) - **data** (object) - Contains the created entry details. - **id** (string) - The unique identifier of the created entry. - **fullName** (string) - The full name of the entry. #### Response Example ```json { "data": { "id": "entry_xyz", "fullName": "Jane Doe" } } ``` ``` -------------------------------- ### POST /v1/invites Source: https://developers.envoy.com/hub/reference/createinvite Creates a new visitor invite. Ensure that the provided flow and employee details (if applicable) match the location for successful creation. ```APIDOC ## POST /v1/invites ### Description Create an invite. Note that the flow and employee (if these are provided) must match up with the location, or invite creation may not succeed. ### Method POST ### Endpoint /v1/invites ### Parameters #### Request Body - **invite** (object) - Required - Object containing invite details. - **inviteId** (string) - Optional - The ID to assign to the invite. If not provided, one will be generated. - **expectedArrivalAt** (string) - Optional - The expected arrival time (UTC) in `date-time` format. - **expectedDepartureAt** (string) - Optional - The expected departure time (UTC) in `date-time` format. - **invitee** (object) - Required - Details of the invitee. - **name** (string) - Required - The name of the invitee. - **email** (string) - Optional - The email of the invitee. - **locationId** (string) - Required - The ID of the location for the invite. Use `GET locations` to find available location IDs. - **flowId** (string) - Required - The ID of the flow to associate with the invite. Use `GET flows` to find available flow IDs. - **notes** (string) - Optional - Internal notes for the invite. - **sendEmailToInvitee** (boolean) - Optional - Whether to send an email to the invitee if an email address is provided. - **hostEmployeeId** (string) - Optional - The employee ID of the internal host associated with the invite. Use `GET employees` to find employee IDs. - **customFields** (array) - Optional - An array of custom fields and the invitee's answers. These must match the flow's sign-in fields exactly, and one must be 'Purpose of visit' with the flow name as the answer. ### Request Example ```json { "invite": { "inviteId": "some-unique-id", "expectedArrivalAt": "2023-10-27T10:00:00Z", "expectedDepartureAt": "2023-10-27T11:00:00Z", "invitee": { "name": "Jane Doe", "email": "jane.doe@example.com" }, "locationId": "loc-12345", "flowId": "flow-abcde", "notes": "Meeting with John Smith.", "sendEmailToInvitee": true, "hostEmployeeId": "emp-67890", "customFields": [ { "field": "Purpose of visit", "answer": "Meeting with John Smith" } ] } } ``` ### Response #### Success Response (200) - **invite** (object) - Details of the created invite. - **inviteId** (string) - The unique identifier for the invite. - **status** (string) - The current status of the invite (e.g., 'pending', 'approved', 'arrived'). #### Response Example ```json { "invite": { "inviteId": "some-unique-id", "status": "pending" } } ``` ``` -------------------------------- ### Get a Space using Node.js Source: https://developers.envoy.com/hub/reference/spaces This example shows how to fetch space details using Node.js, likely with a library like 'axios' or the built-in 'fetch'. It constructs the request URL with the space ID and sets the appropriate 'accept' header for a JSON response. ```javascript // Node.js example (assuming 'axios' or similar library) // const axios = require('axios'); // const spaceId = 'your_space_id'; // // axios.get(`https://api.envoy.com/v1/spaces/${spaceId}`, { // headers: { // 'accept': 'application/json' // } // }) // .then(response => { // console.log(response.data); // }) // .catch(error => { // console.error('Error fetching space:', error); // }); ``` -------------------------------- ### Fetch Employees List - PHP Source: https://developers.envoy.com/hub/reference/employees-2 Example of fetching employee data using PHP. This snippet utilizes cURL to send a GET request to the Envoy employees API, including query parameters for pagination and setting the appropriate 'Accept' header. ```php ```