### List Profiles - Node.js Example Source: https://developers.everbridge.net/home/reference/ebs-list-profiles This Node.js example demonstrates how to make a GET request to the profiles endpoint, including the necessary authorization header. ```javascript const axios = require('axios'); const organizationId = '{organizationId}'; const credentials = ''; // Replace with your base64 encoded credentials axios.get(`https://api.everbridge.net/rest/profiles/${organizationId}`, { headers: { 'Authorization': `Basic ${credentials}` } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching profiles:', error); }); ``` -------------------------------- ### List Notification Templates - PHP Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-templates A PHP example for listing notification templates. This uses cURL to make the GET request. ```php ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-get-email-list This example demonstrates how to make a GET request to retrieve the email list using cURL. Ensure you replace placeholder values with your actual organization ID and API endpoint. ```shell curl --request GET \ --url https://api.everbridge.net/rest/uploadContacts/1536984111644674/getEmailListForSendingNotification \ --header 'accept: application/json' ``` -------------------------------- ### GraphQL Query Example (Shell) Source: https://developers.everbridge.net/home/reference/graphql-query An example of how to construct a GraphQL query using shell. ```shell Loading… ``` -------------------------------- ### List Notification Templates - Ruby Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-templates This Ruby code snippet demonstrates how to fetch notification templates. You may need to install the 'rest-client' gem. ```ruby require 'rest-client' url = "https://api.everbridge.net/rest/notificationTemplates/{organizationId}" begin response = RestClient.get url puts "Status Code: #{response.code}" puts "Response Body: #{response.body}" rescue RestClient::ExceptionWithResponse => e puts "Error: #{e.response.code} - #{e.response.body}" end ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-get-staff-assigned-by-calendar-externalid Demonstrates how to make a GET request to retrieve staff assignments using cURL. Ensure to replace placeholder values with actual organization and external IDs. ```Shell curl --request GET \ --url https://api.everbridge.net/rest/staff/organizationId/assignment/externalId \ --header 'accept: application/json' ``` -------------------------------- ### Example: Using a Search Option Source: https://developers.everbridge.net/home/reference/ebs-get-incident-variables-proxy This example demonstrates how to use the 'Name' search option to retrieve incident variables. ```http GET /incidentVariableItems/1536984111644674/Name ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-get-contacts-groups-upload-status This example demonstrates how to make a GET request to retrieve the status of a group upload batch using cURL. Ensure you replace `uploadBatchId` with the actual ID. ```shell curl --request GET \ --url https://api.everbridge.net/rest/uploads/1536984111644674/groups/uploadBatchId \ --header 'accept: application/json' ``` -------------------------------- ### Retrieve Contact Summary (Ruby) Source: https://developers.everbridge.net/home/reference/getsummary This Ruby example shows how to fetch the contact summary for a session using an HTTP GET request. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://api.everbridge.net/managerapps/communications/v1/contact-builder/{sessionId}/summary') response = Net::HTTP.get_response(uri) puts response.body ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/eb-am-list-uploaded-asset-detail-by-status Demonstrates how to make a GET request to list uploaded asset details by status using cURL. Ensure to include the required 'X-EB-Organization-Id' header. ```shell curl --request GET \ --url 'https://api.everbridge.net/rest/v2/asset-management/upload-assets?pageNumber=1' \ --header 'X-EB-Organization-Id: 1536984111644674' \ --header 'accept: application/json' ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-create-shift-substitutions Example of how to create shift substitutions using cURL. ```Shell curl --request POST \ --url https://api.everbridge.net/rest/scheduling/1536984111644674/shiftSubstitutions \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-upload-dynamic-locations Example of how to make a POST request to upload dynamic locations using cURL. ```shell curl --request POST \ --url https://api.everbridge.net/rest/dynamicLocations/1536984111644674 \ --header 'accept: application/json' \ --header 'content-type: multipart/form-data' ``` -------------------------------- ### Contact Update Request Body Examples Source: https://developers.everbridge.net/home/reference/ebs-update-contacts-batch These examples demonstrate the structure of the request body for updating contact information, including specifying contact details and delivery paths. The second example shows an alternative way to specify the path using a prompt. ```json { "firstName": "F", "lastName": "L", "externalId": "001", "recordTypeId": 1533823015714817, "paths": [ { "pathId": 241901148045319, "countryCode": "CN", "value": "17525889654" } ] } ``` ```json { "firstName": "F", "lastName": "L", "externalId": "001", "recordTypeId": 1533823015714817, "paths": [ { "prompt": "phone", "countryCode": "CN", "value": "17525889654" } ] } ``` -------------------------------- ### List Profiles - Python Example Source: https://developers.everbridge.net/home/reference/ebs-list-profiles This Python example uses the 'requests' library to fetch profiles, demonstrating how to pass the Basic Authorization header. ```python import requests organization_id = '{organizationId}' credentials = '' # Replace with your base64 encoded credentials url = f"https://api.everbridge.net/rest/profiles/{organization_id}" headers = { 'Authorization': f'Basic {credentials}' } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes print(response.json()) except requests.exceptions.RequestException as e: print(f'Error fetching profiles: {e}') ``` -------------------------------- ### Push a safety device event Source: https://developers.everbridge.net/home/openapi/696feb1f9dd18d557ce085ca This method allows you to push a safety device event, such as an SOS or CheckIn. It requires client_credential grant type authentication. Refer to the OAuth section of the getting started guide for authentication details. ```APIDOC ## POST /devices ### Description Push a safety device event. This method only supports the client_credential grant type authentication. ### Method POST ### Endpoint /devices ### Request Body - **deviceId** (string) - Required - ID or IMEI, limited to 64 characters. - **eventType** (string) - Required - Event Type: SOS, CheckIn. - **eventTime** (string) - Required - Actual event time in ISO 8601 format, suggested in `YYYY-MM-DDThh:mm:ss.sssZ` format. - **message** (string) - Optional - Plain text message, limited to 1,024 characters. - **location** (object) - Optional - - **latitude** (number) - Required - Latitude. - **longitude** (number) - Required - Longitude. - **battery** (string) - Optional - Battery percentage, 0-100. - **temperature** (string) - Optional - Temperature in Celsius. - **vendor** (string) - Optional - Vendor, limited to 64 characters. ### Request Example ```json { "deviceId": "100000001", "eventType": "SOS", "eventTime": "2024-02-07T01:59:36.622Z", "message": "Report an SOS event", "location": { "latitude": 12.34, "longitude": 123.456 }, "battery": "50.1", "temperature": "20.3", "vendor": "vendor" } ``` ### Response #### Success Response (200) - **status** (string) - OK - **message** (string) - The event was created. - **data** (object) - - **deviceId** (string) - ID of the device. - **eventId** (string) - ID of the event. #### Response Example ```json { "status": 200, "message": "The event was created.", "data": { "deviceId": "100000001", "eventId": "0dffeebf-50ee-46c0-8bb3-29dd54e3f610" } } ``` #### Error Response (400) - **status** (string) - Request status - **message** (string) - Missing or invalid request parameter #### Error Response (403) - **status** (string) - Invalid credentials - **title** (string) - ACCESS_DENIED - **detail** (string) - Authorization failure #### Error Response (500) - **status** (string) - Internal Error - **message** (string) - Data access error ``` -------------------------------- ### List Profiles - Ruby Example Source: https://developers.everbridge.net/home/reference/ebs-list-profiles This Ruby script shows how to fetch profiles using the Net::HTTP library, ensuring the correct Authorization header is set. ```ruby require 'net/http' require 'uri' uri = URI.parse("https://api.everbridge.net/rest/profiles/{organizationId}") request = Net::HTTP::Get.new(uri) request["Authorization"] = "Basic " # Replace with your base64 encoded credentials response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(request) end puts response.body ``` -------------------------------- ### Get Asset Type - PHP Example Source: https://developers.everbridge.net/home/reference/ebs-am-get-asset-type This PHP example uses cURL to fetch an asset type. It includes the organization ID in the request headers. ```php ``` -------------------------------- ### Create Asset with Most Properties Source: https://developers.everbridge.net/home/openapi/68b7465109bdc1c0adf9a1a1 This example demonstrates creating an asset with a comprehensive set of properties, including address details and associations. The timestamps should be in milliseconds. ```json { "assetTypeId": "665856825d59930bc2151633", "name": "Office Address2", "externalId": "c-vishal.agrawal5@everbridge.com", "category": "office", "notes": "Everbridge Bangalore Office", "startTimestamp": 1738175400000, "endTimestamp": 1738261800000, "isEditMode": false, "address": { "country": "IN", "state": "Karnataka (IN)", "streetAddress1": "1st Floor, Everbridge Pvt Ltd", "streetAddress2": "9th cross road, Silver spring layout, Whitefield", "city": "Bangalore", "postalCode": "560037" }, "associations": [ { "associationDefinitionId": "665857c05d59930bc2151643", "entityIds": [ 2668619410440194 ], "entityType": "Contact" } ] } ``` -------------------------------- ### List Notification Categories - Python Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-categories Example of how to list notification categories using Python. This snippet demonstrates making an HTTP GET request to the specified API endpoint. ```Python import http.client conn = http.client.HTTPSConnection("api.everbridge.net") conn.request("GET", "/rest/notificationCategories/1536984111644674") response = conn.getresponse() data = response.read() print(data.decode("utf-8")) ``` -------------------------------- ### List Notification Categories - PHP Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-categories Example of how to list notification categories using PHP. This snippet demonstrates making an HTTP GET request to the specified API endpoint. ```PHP "https://api.everbridge.net/rest/notificationCategories/1536984111644674", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:' . $err; } else { echo $response; } ``` -------------------------------- ### List Notification Categories - Ruby Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-categories Example of how to list notification categories using Ruby. This snippet demonstrates making an HTTP GET request to the specified API endpoint. ```Ruby require 'net/http' require 'uri' uri = URI.parse("https://api.everbridge.net/rest/notificationCategories/1536984111644674") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) puts response.code puts response.message puts response.body ``` -------------------------------- ### Create Launch Policy cURL Request Source: https://developers.everbridge.net/home/reference/ebs-create-launch-policy This example demonstrates how to create a launch policy using a cURL request. Ensure you replace 'organizationId' with your actual organization ID. ```shell curl --request POST \ --url https://api.everbridge.net/rest/launchPolicies/organizationId \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### List Notification Categories - Node.js Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-categories Example of how to list notification categories using Node.js. This snippet demonstrates making an HTTP GET request to the specified API endpoint. ```Node.js const https = require('https'); const options = { hostname: 'api.everbridge.net', port: 443, path: '/rest/notificationCategories/1536984111644674', method: 'GET', headers: { 'Content-Type': 'application/json' } }; const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); ``` -------------------------------- ### POST /assets/quick-search - Example Success Response Source: https://developers.everbridge.net/home/openapi/690c7bbe4f0e6f8b11847360 An example of a successful response for the quick search endpoint. It returns a paginated data structure containing a list of assets that match the search criteria. ```json { "pageSize": 10, "start": 0, "totalCount": 1, "data": [ { "id": "2349176922832899", "organizationId": 1536984111644674, "createdId": 2200330536222721, "createdName": "Nandish API Access", "lastModifiedId": 2200330536222721, "lastModifiedName": "Nandish API Access", "createdTimestamp": 1717670350862, "lastModifiedTimestamp": 1717670350862, "externalId": "809809@gm", "assetTypeId": "665ff8e1a1b61d39e577b9c6", "name": "string", "address": { "country": "IN", "state": "string", "city": "Bangalore", "postalCode": "string", "streetAddress1": "string", "streetAddress2": "string" } } ] } ``` -------------------------------- ### List Profiles - Shell Example Source: https://developers.everbridge.net/home/reference/ebs-list-profiles Use this command to retrieve a list of profiles from a specified organization using basic authentication. ```shell curl -X GET https://api.everbridge.net/rest/profiles/{organizationId} \ -H "Authorization: Basic " ``` -------------------------------- ### Create Plan Request (cURL) Source: https://developers.everbridge.net/home/reference/createplan This example demonstrates how to create a new Comms plan using a cURL request. Ensure you include the correct URL, accept, and content-type headers. ```shell curl --request POST \ --url https://api.everbridge.net/managerapps/communications/v1/plans \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get Asset Type - Ruby Example Source: https://developers.everbridge.net/home/reference/ebs-am-get-asset-type This Ruby code snippet shows how to make a GET request to retrieve an asset type. It specifies the required organization ID header. ```ruby require 'httparty' organization_id = 1536984111644674 asset_type_id = '{id}' # Replace with the actual asset type ID response = HTTParty.get("https://api.everbridge.net/rest/v2/asset-management/asset-types/#{asset_type_id}", headers: { 'X-EB-Organization-Id' => organization_id.to_s } ) if response.success? puts "Asset Type: #{response.parsed_response}" else puts "Error fetching asset type: #{response.code} - #{response.message}" end ``` -------------------------------- ### Create Batch Assets Request Example Source: https://developers.everbridge.net/home/reference/ebs-am-create-batch-assets This example demonstrates how to construct a request body for creating multiple assets in a batch. Ensure the 'X-EB-Organization-Id' header is included with your organization's ID. ```json { "assets": [ { "assetType": "DEVICE", "attributes": { "name": "My Device 1", "contactInfo": "user@example.com" } }, { "assetType": "DEVICE", "attributes": { "name": "My Device 2", "contactInfo": "anotheruser@example.com" } } ] } ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/preview-from-template This example demonstrates how to make a POST request to the Preview From Template API using cURL. Ensure you include the correct URL and content type headers. ```curl curl --request POST \ --url https://api.snapcomms.com/v1/content/previewFromTemplate \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get Publishing Statistics Source: https://developers.everbridge.net/home/openapi/6310b5f68a3b6f0d7e0290a7 Retrieves publishing statistics for content, with options to filter by start and end dates. ```APIDOC ## GET /reports/publishingstatistics ### Description Retrieves publishing statistics for content. ### Method GET ### Endpoint /reports/publishingstatistics ### Parameters #### Query Parameters - **startDate** (string) - Optional - Defaults to UTC minus 7 days (e.g. 2023-05-08T04:24:56.463Z) - **endDate** (string) - Optional - Defaults to UTC (e.g. 2023-05-08T04:24:56.463Z) ### Response #### Success Response (200) - **content** (array) - Publishing statistics data. - **successSummary** (object) - Summary of publishing success rates by content type, folder, and publisher. #### Response Example ```json { "content": [ { "publishDate": "2023-05-08T04:24:56.4630000+00:00", "name": "CEO Update Video Alert", "version": "1", "channel": "Video Alert", "folder": "FolderName", "templateName": "Video Alert", "publisher": "publisher@company.com", "creator": "creator@company.com", "successPercentage": "100.00", "targetedCount": "1", "reachCount": "1", "totalReadCount": "1", "readCount": "1", "completedCount": "0", "totalReadLaterCount": "0", "totalDismissedCount": "0", "totalPopupCount": "1", "clientID": "bf732195-5825-4de1-ae8e-2d532ed5da54", "campaignID": "bf732195-5825-4de1-ae8e-2d532ed5da54", "assetTypeID": "101", "assetID": "bf732195-5825-4de1-ae8e-2d532ed5da54", "templateID": "bf732195-5825-4de1-ae8e-2d532ed5da54", "itemId": "bf732195-5825-4de1-ae8e-2d532ed5da54", "lastUpdated": "2023-05-08T04:25:50.1800000+00:00", "startDate": "2023-05-08T04:24:56.4630000+00:00", "startDateFormat": "UTC", "endDate": "2023-05-15T04:24:54.1800000+00:00", "endDateFormat": "UTC" } ], "successSummary": { "contentTypes": [ { "label": "Video Alert", "value": "100.00" } ], "folders": [ { "label": "Test", "value": "100.00" } ], "publishers": [ { "label": "publisher@company.com", "value": "100.00" } ] } } ``` ``` -------------------------------- ### Retrieve Contact Summary (Python) Source: https://developers.everbridge.net/home/reference/getsummary This Python example uses the requests library to get the contact summary for a session. ```python import requests url = "https://api.everbridge.net/managerapps/communications/v1/contact-builder/{sessionId}/summary" response = requests.get(url) print(response.text) ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-query-itineraries-by-parameters This example demonstrates how to construct a cURL request to query itineraries. Ensure you replace 'organizationId' with your actual organization ID and include the necessary authorization header. ```shell curl --request POST \ --url 'https://api.everbridge.net/rest/itineraries/query/organizationId?pageNumber=1' \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Retrieve Session Metadata (Python) Source: https://developers.everbridge.net/home/reference/getsession Python script to get session metadata. This example uses the 'requests' library. ```python import requests session_id = '{sessionId}' # Replace with your session ID url = f"https://api.everbridge.net/managerapps/communications/v1/contact-builder/{session_id}" response = requests.get(url) print(response.status_code) print(response.json()) ``` -------------------------------- ### Retrieve Contact Summary (Node.js) Source: https://developers.everbridge.net/home/reference/getsummary This Node.js example demonstrates how to make a GET request to retrieve the contact summary for a session. ```javascript const https = require('https'); const options = { hostname: 'api.everbridge.net', port: 443, path: '/managerapps/communications/v1/contact-builder/{sessionId}/summary', method: 'GET', headers: { 'Content-Type': 'application/json' } }; const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); ``` -------------------------------- ### List Notification Templates - Python Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-templates This Python script shows how to retrieve notification templates. It uses the 'requests' library. ```python import requests organization_id = '{organizationId}' # Replace with your organization ID url = f"https://api.everbridge.net/rest/notificationTemplates/{organization_id}" try: response = requests.get(url) response.raise_for_status() # Raise an exception for bad status codes print(f"Status Code: {response.status_code}") print(f"Response Body: {response.json()}") except requests.exceptions.RequestException as e: print(f"Error: {e}") ``` -------------------------------- ### Get Attributes Response (No Attributes) Source: https://developers.everbridge.net/home/reference/ebs-v1-attribute-lookup-rest-apis Example response when no attributes are found for the specified organization ID. The 'data' field will be an empty array. ```JSON { "data": [] } ``` -------------------------------- ### Example: With Template ID and Phase Source: https://developers.everbridge.net/home/reference/ebs-get-incident-variables-proxy This example shows how to retrieve incident variables using a specific template ID and phase. ```http GET /incidentVariableItems/1536984111644674/34352544264426/Update ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-daa-create-panic This example demonstrates how to make a POST request to the Create Panic endpoint using cURL. Ensure you include the necessary headers and a JSON body with panic details. ```shell curl --request POST \ --url https://api.everbridge.net/digitalapps/v2/contacts/panics \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get Attributes Response (Success) Source: https://developers.everbridge.net/home/reference/ebs-v1-attribute-lookup-rest-apis Example of a successful response when retrieving attributes for an organization. It includes attribute names, values, and metadata. ```JSON { "data": [ { "name": "Location", "values": [ "Boston", "NY", "Pasadena" ], "id": "5a58faabd4131828ab9dbdc1", "organizationId": 888409690212728, "lastUpdatedBy": "xyz", "lastUpdatedOn": "2018-01-12T18:12:59.602Z" }, { "name": "Group Type", "values": [ "Accountable team", "Informedf", "Resolver" ], "id": "5a58fccdd4131828ab9dbdcb", "organizationId": 888409690212728, "lastUpdatedBy": "xyz", "lastUpdatedOn": "2018-01-12T18:22:05.437Z" }, { "name": "Product", "values": [ "Dell", "Hardware", "Oracle", "SQL" ], "id": "5a986e36d41318563766e021", "organizationId": 888409690212728, "lastUpdatedBy": "xyz", "lastUpdatedOn": "2018-03-01T21:18:46.914Z" }, . . . ] } ``` -------------------------------- ### Get Asset Type - Shell Example Source: https://developers.everbridge.net/home/reference/ebs-am-get-asset-type Use this shell command to retrieve a specific asset type by its ID. Ensure you have your organization ID. ```shell curl -X GET https://api.everbridge.net/rest/v2/asset-management/asset-types/{id} \ -H "X-EB-Organization-Id: 1536984111644674" ``` -------------------------------- ### Example cURL Request to List Calendar Events Source: https://developers.everbridge.net/home/reference/ebs-list-calendar-events This example demonstrates how to make a GET request to the Everbridge API to retrieve calendar events. It includes parameters for including related resources, specifying fields, setting a date range, and filtering by calendar ID. ```shell curl -X GET 'https://api-qal.everbridge.net/rest/scheduling/888409690212737/calendarEvents?include=contact,calendar,shiftSchedule,staffSchedule&fields[calendar]=name&fields[shiftSchedule]= name&fields[staffSchedule]=name&start=2019-11-19T00:00:00-05:00&days=3&filter[calendarId]=293024143839397' H'Authorization: Basic cGF1bG9taS5tYWhpZGhhcmIhOlBhdWx=' ``` -------------------------------- ### cURL Request Example Source: https://developers.everbridge.net/home/reference/ebs-create-dynamic-location-for-contact This example demonstrates how to make a POST request to create a dynamic location for a contact using cURL. Ensure you replace placeholder values with actual organization and contact IDs. ```Shell curl --request POST \ --url 'https://api.everbridge.net/rest/lastknownlocations/organizationId/contactId?contactIdType=id' \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### List Contexts using cURL Source: https://developers.everbridge.net/home/reference/context-apis Demonstrates how to list available Comms contexts using a cURL request. Includes example URL, query parameters for pagination, and the accept header. ```shell curl --request GET \ --url 'https://api.everbridge.net/managerapps/communications/v1/context/?pageSize=10&pageNumber=1' \ --header 'accept: application/json' ``` -------------------------------- ### Get Attributes Response (Org Not Accessible) Source: https://developers.everbridge.net/home/reference/ebs-v1-attribute-lookup-rest-apis Example of an unauthorized response when the organization is not accessible to the user or does not exist. It provides a status code and a descriptive message. ```JSON { "status": 401, "message": "Org 888409690212728 not accessible to this user, or does not exist." } ``` -------------------------------- ### Get Attributes Response (Unauthorized) Source: https://developers.everbridge.net/home/reference/ebs-v1-attribute-lookup-rest-apis Example of an unauthorized response due to an invalid JWT access token. The response includes an error code and message. ```JSON { "code": 401, "message": "Unauthorized" } ``` -------------------------------- ### Get Asset Type - Node.js Example Source: https://developers.everbridge.net/home/reference/ebs-am-get-asset-type This Node.js snippet demonstrates how to fetch an asset type using its ID. It includes the necessary headers for authentication. ```javascript const axios = require('axios'); const organizationId = 1536984111644674; const assetTypeId = '{id}'; // Replace with the actual asset type ID axios.get(`https://api.everbridge.net/rest/v2/asset-management/asset-types/${assetTypeId}`, { headers: { 'X-EB-Organization-Id': organizationId } }) .then(response => { console.log('Asset Type:', response.data); }) .catch(error => { console.error('Error fetching asset type:', error); }); ``` -------------------------------- ### Contact Path Example - Email Source: https://developers.everbridge.net/home/reference/ebs-create-contacts-batch Provides an example of a contact path object for an email address, including validation settings. ```json { "waitTime": 0, "pathId": 241901148045316, "value": "homer@snpp.com", "skipValidation": false } ``` -------------------------------- ### Example: ID Search Option Filter (Shell) Source: https://developers.everbridge.net/home/reference/ebs-get-incident-variables-proxy This shell command demonstrates how to make a GET request to retrieve incident variables using the 'ID' search option. ```shell curl -X GET \ 'https://api.everbridge.net/rest/incidentVariableItems/organizationId/ID' \ -H 'accept: application/json' ``` -------------------------------- ### List Notification Templates - Node.js Example Source: https://developers.everbridge.net/home/reference/ebs-list-notification-templates Example of how to list notification templates using Node.js. Ensure you have the necessary libraries for making HTTP requests. ```javascript const https = require('https'); const options = { hostname: 'api.everbridge.net', port: 443, path: '/rest/notificationTemplates/{organizationId}', method: 'GET', headers: { 'Content-Type': 'application/json' } }; const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); let responseBody = ''; res.on('data', (chunk) => { responseBody += chunk; }); res.on('end', () => { try { const data = JSON.parse(responseBody); console.log('Response:', data); } catch (err) { console.error('Error parsing JSON:', err); } }); }); req.on('error', (error) => { console.error('Error:', error); }); req.end(); ``` -------------------------------- ### Get Asset Type - Python Example Source: https://developers.everbridge.net/home/reference/ebs-am-get-asset-type This Python snippet shows how to retrieve an asset type using the 'requests' library. It correctly sets the organization ID header. ```python import requests organization_id = 1536984111644674 asset_type_id = '{id}' # Replace with the actual asset type ID url = f"https://api.everbridge.net/rest/v2/asset-management/asset-types/{asset_type_id}" headers = { 'X-EB-Organization-Id': str(organization_id) } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes print("Asset Type:", response.json()) except requests.exceptions.RequestException as e: print(f"Error fetching asset type: {e}") ``` -------------------------------- ### Create a Live Template with Permissions and Variables Source: https://developers.everbridge.net/home/openapi/6977aa45ed75c64cdb418f89 Creates a new Comms template with specified details, including permissions and variables. This operation allows for the creation of a live template with predefined content and configurations. ```APIDOC ## POST /templates ### Description Creates a new Comms template. ### Method POST ### Endpoint /templates ### Request Body - **name** (string) - Required - The name of the template. - **description** (string) - Required - The description of the template. - **priority** (string) - Optional - The priority of the event associated with the template. - **eventTypes** (array) - Optional - A list of event types. - **status** (string) - Required - The status of the template (e.g., LIVE). - **category** (string) - Optional - The category of the template. - **publicSafety** (boolean) - Optional - Indicates if the template is for public safety. - **message** (object) - Required - The message content. - **contents** (array) - Required - An array of message content objects. - **type** (string) - Required - The type of content (e.g., Textual). - **contentType** (string) - Required - The content type (e.g., text/plain). - **title** (string) - Required - The title of the content. - **content** (string) - Required - The main content of the message. - **paths** (array) - Optional - Paths associated with the content. - **recipients** (object) - Optional - The recipients of the communication. - **contacts** (array) - Optional - A list of contacts. - **type** (string) - Required - The type of contact identifier (e.g., ExternalId, Id, Name). - **externalId** (string) - Required if type is ExternalId - The external ID of the contact. - **id** (string) - Required if type is Id - The ID of the contact. - **firstName** (string) - Required if type is Name - The first name of the contact. - **lastName** (string) - Required if type is Name - The last name of the contact. - **publicUsers** (array) - Optional - A list of public users. - **type** (string) - Required - The type of public user identifier (e.g., SemanticQuery). - **command** (object) - Required if type is SemanticQuery - The semantic query command. - **permissions** (object) - Optional - Permissions for the template. - **message** (string) - Optional - Message permission level. - **settings** (string) - Optional - Settings permission level. - **recipients** (string) - Optional - Recipients permission level. - **publicMessage** (object) - Optional - Public message permissions. - **webWidget** (string) - Optional - Web widget permission. - **alertUs** (string) - Optional - AlertUs permission. - **genericOneWay** (string) - Optional - Generic one-way permission. - **audioBulletinBoard** (string) - Optional - Audio bulletin board permission. - **memberPortal** (string) - Optional - Member portal permission. - **network** (string) - Optional - Network permission. - **socialMedia** (string) - Optional - Social media permission. - **variables** (array) - Optional - Variables for the template. - **variableId** (string) - Required - The ID of the variable. - **value** (string) - Required - The value of the variable. - **permission** (string) - Optional - The permission level for the variable. - **required** (boolean) - Optional - Indicates if the variable is required. - **type** (string) - Optional - The type of the variable. ### Responses #### Success Response (200) - **CommsResponse** (object) - Description of the response. #### Error Response (400) - **string** - Description of the error. ``` -------------------------------- ### Standard Notification using Default Settings Source: https://developers.everbridge.net/home/docs/ebs-v1-notifications-overview This example demonstrates how to send a standard notification using default settings. It includes basic broadcast contact information and message content. ```APIDOC ## Standard Notification using Default Settings ### Description This example demonstrates how to send a standard notification using default settings. It includes basic broadcast contact information and message content. ### Request Body ```json { "broadcastContacts": { "contactIds": [ 5743857366033992 ], "externalIds": [], "groupIds": [], "filterIds": [] }, "type": "Standard", "priority": "NonPriority", "launchtype": "SendNow", "message": { "contentType": "Text", "title": "Test with all default settings", "textMessage": "This notification uses all the default settings." } } ``` ```