{"info":{"_postman_id":"e9646500-1a1e-4311-9dfe-f8c589d5f02a","name":"Alfred Community API Documentation","description":"<html><head></head><body><h2 id=\"api-reference\">API Reference</h2>\n<p>The Alfred Community API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.</p>\n<p>This guide explains how to use the reference.</p>\n<h2 id=\"before-you-start\">Before you start</h2>\n<p>You communicate to the Alfred Community API through HTTP messages called requests. Especially if you're coming to us new, you might want to familiarize yourself with Four essential components of an API request — headers, endpoints, methods, and parameters — just so we're speaking the same language going forward.</p>\n<p><em>You can use the API in test mode, which does not affect our live data. The Environment you use to authenticate the request determines the mode of the API. There are two Environments;QA Environment &amp; Production Environment</em></p>\n<h3 id=\"standard-response-object\">Standard Response object</h3>\n<hr>\n<h4 id=\"success-response\">Success Response:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {*JSON Object*},\n    \"statusCode\": 200\n}\n\n</code></pre><h4 id=\"error-response\">Error Response:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"error\": {\"message\": \"Event not found\"},\n    \"statusCode\": 404\n}\n\n</code></pre><p>Above response formats are standard formats you can expect on success or failure of an endpoint.</p>\n<hr>\n<h3 id=\"error-codes\">Error Codes</h3>\n<p>Alfred community uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, or type of parameter was wrong, etc.). Codes in the 5xx range indicate an error with Alfred's servers (these are rare). Error response will be JSON-encoded.</p>\n<h3 id=\"environments\">Environments:</h3>\n<p>There are two environments available; Sandbox &amp; Production. Documentation includes only sandbox environment and to access the production environment you must use our production url after getting approval of production access.  </p>\n<p>PRODUCTION URL : <code>https://developers.hom.events</code></p>\n<h4 id=\"expected-error-codes\">Expected Error Codes</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>404: Resource not found\n401: Authentication Error\n400: Bad Request Payload/Parameter\n403: Forbidden (Suspicious request)\n405: Method not allowed\n406: Request not acceptable (Bad request Payload)\n500: Server Error (Rare)\n502: Bad Gateway (Rare)\n\n</code></pre><hr>\n<h3 id=\"authentication-header-format\">Authentication Header format</h3>\n<p>There are two types of authentication involved in the integration process; Partner Authentication and Partner's User Authentication.</p>\n<h4 id=\"partner-authentication\">Partner Authentication</h4>\n<p>This authentication requires partner to authenticate with Alfred Community system and access the resources. After authentication, partner will receive access token, which he needs to provide in Authorization header to make subsequent request, below is the format:</p>\n<blockquote>\n<p>Authorization: Bearer <code>accessToken</code></p>\n</blockquote>\n<h4 id=\"user-authentication\">User Authentication</h4>\n<p>This authentication requires partner's user to authenticate with Alfred Community system and make action on behalf of user. We create a non-usable account of user on our side in order to keep the consistency in the flow control. After authentication, partner will receive <code>userToken</code>, which he needs to provide in User-Token header to make subsequent requests along with Authorization header:</p>\n<blockquote>\n<p>Authorization: Bearer <code>accessToken</code><br>User-Token: <code>userToken</code></p>\n</blockquote>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"11519099","collectionId":"e9646500-1a1e-4311-9dfe-f8c589d5f02a","publishedId":"UVC5DmoU","public":true,"customColor":{"top-bar":"303030","right-sidebar":"303030","highlight":"Eb2E2A"},"publishDate":"2021-12-02T11:50:53.000Z"},"item":[{"name":"Developer Authentication","event":[{"listen":"test","script":{"id":"cd6fca95-8a71-476a-89eb-fb1ddd4336da","exec":["pm.test(\"Your test name\", function () {","    var jsonData = pm.response.json();","    pm.environment.set('partnerAccess', jsonData.data.access);","});",""],"type":"text/javascript"}}],"id":"1bd44268-88e6-4539-b3ca-ed84ebffad87","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\"identityToken\": \"{{identityToken}}\", \"secret\": \"{{secret}}\"}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/developer-authenticate/","description":"<p>This API uses keys; <code>identityToken</code> and <code>secret</code>, to authenticate requests. You can view and manage your API keys in the <a href=\"http://google.com\">Developer Dashboard</a>.</p>\n<p>Your keys carry many privileges, so be sure to keep them secure! Do not share your keys in publicly accessible areas such as GitHub, client-side code, and so forth.</p>\n<p>All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\n\n\nREQUIRED PARAMETERS:\n\nidentityToken: str\nsecret: str\n</code></pre><h3 id=\"response\">Response</h3>\n<hr />\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"access\": \"eyJ0eXAiOiJK........\"\n    },\n    \"status\": 200\n}\n</code></pre><p>After Success, you will receive an <a href=\"https://jwt.io/introduction\">JWT</a> access token in form of string. This access token will then be used on all endpoints that require developer level authentication. Whenever developer wants to access a protected route or resource, the user agent should send the access token, typically in the Authorization header using the Bearer schema. The content of the header should look like the following:</p>\n<blockquote>\n<p>Authorization: Bearer <em>accessToken</em></p>\n</blockquote>\n<blockquote>\n<h4 id=\"what-is-an-access-token\">What is an Access Token?</h4>\n<p>An Access Token is a credential in the form of string that represents the authorization granted to the resource.</p>\n</blockquote>\n<h3 id=\"request\">Request</h3>\n","urlObject":{"path":["developer-authenticate",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1bd44268-88e6-4539-b3ca-ed84ebffad87"},{"name":"Authenticate Partner User","event":[{"listen":"test","script":{"id":"eea6e9c4-aee9-491f-87d7-df1772172932","exec":["pm.test(\"Your test name\", function () {","    var jsonData = pm.response.json();","    pm.environment.set('userAccess', jsonData.data.userToken);","});"],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"c3a54737-2bb7-40b7-b7b9-7009ae024eca","exec":["pm.environment.set(\"event_id\", 1547);"],"type":"text/javascript"}}],"id":"f080e32e-cf52-4ed4-9bd5-cdf6d6fcaab4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Bearer {{partnerAccess}}","type":"text"}],"body":{"mode":"raw","raw":"{\"firstName\": \"John\", \"lastName\": \"Doe\", \"email\": \"johdoe@example.com\"}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/user-authenticate/","description":"<p>This endpoint creates a user within the service that will correspond to a Partner user. It accepts a user object with and returns a user access token object. This token includes a service-generated user ID and serve as proxy login credentials and are stored in the Alfred Community Platform on behalf of that partner. If the user does not yet exist, it is created and If the user already exists and was originally created by this endpoint earlier, the existing credentials are returned.</p>\n<p>*NOTE: This endpoint requires partner's access token in the headers.</p>\n<p>*</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\n\n\nREQUIRED PARAMETERS:\n\nfirstName: str\nlastName: str\nemail: str (email format)\n</code></pre><h3 id=\"response\">Response</h3>\n<hr />\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"userToken\": \"eyJ0eXAiOiJKV1Qi.........\"\n    },\n    \"statusCode\": 200\n}\n</code></pre><p>After Success, you will receive an access token which contains minimal privileges to do user actions on behalf of user. This access token will then be used on subsequent functional endpoints that require user level authentication in addition to API authentication.</p>\n<h3 id=\"request\">Request</h3>\n","urlObject":{"path":["user-authenticate",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f080e32e-cf52-4ed4-9bd5-cdf6d6fcaab4"},{"name":"Get Buildings","id":"c651216e-8ab7-4b72-8a9e-2d6b071dbac8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/buildings/","description":"<p>Returns a list of your buildings. The buildings are returned sorted by creation date, with the most recent building appearing first.<br />List will contain only buildings for which partner is granted access. List might come empty if partner doesn't have access or access is blocked.</p>\n<p><em>NOTE: Partner's access token is required</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"buildings\": [\n            {\"buildingCode\": \"realproperties\", \"name\": \"Real Properties},\n            {\"buildingCode\": \"americanestates\", \"name\": \"American Estates}\n         ]\n    },\n    \"statusCode\": 200\n}\n</code></pre><h3 id=\"request\">Request</h3>\n","urlObject":{"path":["buildings",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c651216e-8ab7-4b72-8a9e-2d6b071dbac8"},{"name":"Get All Events","id":"cc4a63f4-b164-4acf-a26e-8af4eee1259e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/events/?page=0&limit=10&deliveryMode=in-person&eventType=social","description":"<p>Returns a list of future events , sorted by event-date. By default, all events are included with page limit of 10. You can always filter your events by using the startDate, deliveryMode and eventType parameters.</p>\n<h3 id=\"parameters\">Parameters:</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\n\n\nOPTIONAL PARAMETERS:\n\n\nstartDate : YYYY-MM-DD (str)\ndeliveryMode: virtual or in-person (str)\neventType: social or fitness (str)\n</code></pre><h3 id=\"pagination\">Pagination</h3>\n<p>By default page=0 and limit=10 is applied, which means you will get first 10 upcoming events in response.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>page : starting from 0 till (totalCount/limit)\nlimit: any valid integer value\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"events\": {\n            \"events\": [\n\n                {\n                    \"id\": 1610,\n                    \"displayName\": \"Functional Movement\",\n                    \"defaultImage\": \"homh-site-media.s3.amazonaws.com/media/uploads/1620568402.941791--hom-media--Functional5virtual.png\",\n                    \"dateTime\": {\n                        \"timezone\": \"UTC\",\n                        \"startDateTime\": \"2021-11-10T19:15:00Z\",\n                        \"endDateTime\": \"2021-11-10T19:30:00Z\"\n                    },\n                    \"eventType\": \"Fitness\",\n                    \"deliveryMode\": \"virtual\",\n                    \"venue\": \"Streaming on app\"\n                },\n\n\n                {\n                    \"id\": 1635 ............\n                }\n            ],\n            \"count\": 121\n        }\n    },\n    \"statusCode\": 200\n}\n</code></pre><hr />\n<h3 id=\"datetime-object\">Datetime Object</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>timezone: string\nstartDateTime: date time in UTC\nendDateTime: date time in UTC\n</code></pre><h3 id=\"event-object\">Event Object</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>id: integer\ndisplayName: string\ndefaultImage: string\ndateTime: Datetime Object\neventType: string (social or fitness)\ndeliveryMode: string (in-person or virtual)\nvenue: string\n</code></pre><hr />\n<h3 id=\"request\">Request</h3>\n","urlObject":{"path":["events",""],"host":["{{base_url}}"],"query":[{"key":"page","value":"0"},{"key":"limit","value":"10"},{"key":"deliveryMode","value":"in-person"},{"key":"eventType","value":"social"}],"variable":[]}},"response":[],"_postman_id":"cc4a63f4-b164-4acf-a26e-8af4eee1259e"},{"name":"Get Event Livestream","event":[{"listen":"prerequest","script":{"id":"36278673-2a23-467b-a49e-4acaf21534c0","exec":["pm.environment.set(\"eventId\", 1635);"],"type":"text/javascript"}}],"id":"696be949-de63-4145-b4a7-b4892d93e989","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"GET","header":[{"key":"User-Token","value":"{{userAccess}}","type":"text"}],"url":"{{base_url}}/livestream/<event_id>/","description":"<p>Returns a secure signed livestream url, which has an expiry time. After event ends stream will not be accessible from this url.</p>\n<p><strong>This API endpoint should be used only when you have event delivery mode as</strong> <strong><code>virtual</code></strong> <strong>.</strong> For in-person events this API endpoint will return empty string, so make sure your conditional check should enabled on your end before hitting the endpoint.</p>\n<p>*NOTE: Partner token and User token is required</p>\n<p>*</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\nUser-Token: {{userAccessToken}}\n\n\nURL PARAMETERS:\n\neventId: int\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"livestreamUrl\": \"https://promenade.kadbu.com/livestream/16101/?signedToken=eyJleHBpcmVzX29uIjogIjIwMjEtMTEtMTAgMTk6MzA6MDArMDA6MDAiLCAiZXZlbnRfaWQiOiAxNjEwLCAidGVuYW50X2lkIjogMTE2ODl9&amp;identityToken=fa02b510-5cff-4903-925b-5ea1d0d8a020&amp;building-code=promenade\"\n    },\n    \"statusCode\": 200\n}\n</code></pre><p><code>livestreamUrl</code> is the direct link of the event livestream on Alfred community tenant app. You need to redirect on the <code>livestreamUrl</code> in order to see the live event.</p>\n<hr />\n<h3 id=\"request\">Request</h3>\n","urlObject":{"path":["livestream","<event_id>",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"696be949-de63-4145-b4a7-b4892d93e989"},{"name":"Get Events Bookings","id":"43a07a2a-a9e5-4e57-83ac-652bc9b71df9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"GET","header":[{"key":"User-Token","value":"{{userAccess}}","type":"text"}],"url":"{{base_url}}/events/bookings/?page=0&limit=10&all=1","description":"<p>This endpoints lists all the event bookings of specific user.</p>\n<p>*NOTE: Partner's token and User Token needs to be passed in headers</p>\n<p>*</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\nUser-Token: {{userAccessToken}}\n</code></pre><h3 id=\"response\">Response</h3>\n<p>Same as in all event listing endpoint.</p>\n<h3 id=\"request\">Request</h3>\n<p>This endpoint expects one more url parameter <code>all=1</code> which overrides the pagination parameters (<code>page</code> and <code>limit</code>) and send all booking at once.</p>\n","urlObject":{"path":["events","bookings",""],"host":["{{base_url}}"],"query":[{"key":"page","value":"0"},{"key":"limit","value":"10"},{"key":"all","value":"1"}],"variable":[]}},"response":[],"_postman_id":"43a07a2a-a9e5-4e57-83ac-652bc9b71df9"},{"name":"Create Event Booking","event":[{"listen":"prerequest","script":{"id":"ba4596ef-a3f3-42b8-b63c-52fd2413e4a2","exec":["pm.environment.set(\"event_id\", 3186);"],"type":"text/javascript"}}],"id":"fdaf4c76-9668-445f-b772-595702abcd4a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"POST","header":[{"key":"User-Token","value":"{{userAccess}}","type":"text"}],"url":"{{base_url}}/events/bookings/<event_id>/","description":"<p>Booking a slot of an event on behalf of partner's user.</p>\n<p>*NOTE: Partner's token and User token needs to be passed in headers *  </p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n \nAuthorization: Bearer {{AccessToken}}\nUser-Token: {{userAccessToken}}\n\nURL PARAMETERS:\neventId: int\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"message\": \"Event slot booked\"\n    },\n    \"statusCode\": 200\n}\n</code></pre><h3 id=\"request\">Request</h3>\n","urlObject":{"path":["events","bookings","<event_id>",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"fdaf4c76-9668-445f-b772-595702abcd4a"},{"name":"Cancel Event Booking","id":"5942154a-51cb-418f-bbf3-3a7cc9c3569a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"DELETE","header":[{"key":"User-Token","value":"{{userAccess}}","type":"text"}],"url":"{{base_url}}/events/bookings/<event_id>/","description":"<p>Cancelling partner's user's existing booking. You need to supply the unique customer identifier that was returned upon event listing's event object.</p>\n<p>*NOTE: Partner's token and User's token is required</p>\n<p>*</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n\nAuthorization: Bearer {{AccessToken}}\nUser-Token: {{userAccessToken}}\n\nURL PARAMETERS:\n\neventId: int\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"message\": \"Booking Cancelled\"\n    },\n    \"statusCode\": 200\n}\n</code></pre>","urlObject":{"path":["events","bookings","<event_id>",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"5942154a-51cb-418f-bbf3-3a7cc9c3569a"},{"name":"Rating And Feedback of an attended event","event":[{"listen":"prerequest","script":{"id":"554b7370-7bce-47a0-9347-1191ed88b723","exec":["pm.environment.set(\"event_id\", 1635);"],"type":"text/javascript"}}],"id":"4813623c-ec71-4e68-9d79-dac3a4bec5d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{partnerAccess}}"},"isInherited":false},"method":"PUT","header":[{"key":"User-Token","value":"{{userAccess}}","type":"text"}],"body":{"mode":"raw","raw":"{\"feedback\": \"Event was very good\", \"rating\": 5}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/events/bookings/<event_id>/","description":"<p>This endpoint accepts feedback and rating of an attended event by Partner's user. For this user must have to attend the event, only after that user can rate the event and also give feedback.</p>\n<p>*NOTE: Partner's token and User's token is required  </p>\n<ul>\n<li></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>REQUIRED HEADERS:\n \nAuthorization: Bearer {{AccessToken}}\nUser-Token: {{userAccessToken}}\n\nREQUIRED PARAMETERS:\nfeedback: str\nrating: int (1 to 5)\n\nURL PARAMETERS:\neventId: int\n</code></pre><h3 id=\"response\">Response</h3>\n<p>HTTP 200</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"data\": {\n        \"message\": \"Rating saved\"\n    },\n    \"statusCode\": 200\n}\n</code></pre>","urlObject":{"path":["events","bookings","<event_id>",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"4813623c-ec71-4e68-9d79-dac3a4bec5d6"}]}