{"id":48,"date":"2021-04-21T00:47:50","date_gmt":"2021-04-21T00:47:50","guid":{"rendered":"https:\/\/smarterwx.1100.com.au\/help\/?post_type=article&#038;p=48"},"modified":"2023-12-07T13:53:34","modified_gmt":"2023-12-07T02:53:34","slug":"api-integration","status":"publish","type":"article","link":"https:\/\/smarterwx.1100.com.au\/help\/article\/api-integration\/","title":{"rendered":"API integration"},"content":{"rendered":"<p>The Application Programming Interface (API) for the BYDA referral service is a public specification allowing developers to build tools and applications that add additional value or customisation to the referral service.<\/p>\n<p><!--more--><\/p>\n<h4>API Keys<\/h4>\n<p>To access the <a href=\"https:\/\/smarterwx.1100.com.au\/help\/faq\/what-is-smarterwx-sentinel\/\">SmarterWX Sentinel<\/a> API, you must first create a set of API credentials that allow programmatic access to the BYDA referral service. This is done through the web application.<\/p>\n<ol>\n<li><strong>Enable developer tools<\/strong>: From the user menu in the top-left corner, edit your user profile and switch on the <a href=\"\/help\/article\/accessing-developer-tools\/\">Developer Tools option<\/a>.<\/li>\n<li><strong>API keys<\/strong>: Go to Developer tools -&gt; API keys on the main menu.<\/li>\n<li><strong>Generate key<\/strong>: Click on Generate API key.<\/li>\n<li><strong>Copy credentials<\/strong>: Make a copy of the Client ID and Client Secret. The client secret cannot be retrieved later.<\/li>\n<\/ol>\n<p><img class=\"aligncenter size-medium wp-image-206\" data-original=\"https:\/\/smarterwx.1100.com.au\/help\/wp-content\/uploads\/2021\/05\/api-key-success-300x295.png\" alt=\"API key success page\" width=\"300\" height=\"295\" \/><\/p>\n<p>Notes:<\/p>\n<ul>\n<li>You can only have a maximum of 2 API keys per user.<\/li>\n<li>Your API key provides the same level of permissions as your login. Treat the key as if it was your own password.<\/li>\n<li>You can delete a key at any time to immediately revoke all permissions.<\/li>\n<\/ul>\n<h4>Authentication<\/h4>\n<p>All requests to the API should include an <code>Authorization<\/code> HTTP header containing a token generated from your API key. To exchange the API key for an authorisation token, a call is made to the <code>\/api\/community\/auth\/tokens<\/code> endpoint.<\/p>\n<pre>URL: https:\/\/smarterwx.1100.com.au\/api\/community\/auth\/tokens\r\nHTTP Method: POST\r\nContent-Type: application\/json\r\nBody: { \"clientId\": \"ABC123DEF456\", \"clientSecret\": \"XXXXXXXXXXXXXXXX\" }\r\n<\/pre>\n<p>The response from this request will contain the authorisation token. This is a short-lived token that must be sent with all subsequent requests in the <code>Authorization<\/code> HTTP header.<\/p>\n<pre>{ \"access_token\": \"saf98vsaahkjs87asdsadfbccxfsa_sdf8687as=\" }\r\n<\/pre>\n<p><!--\nIf your user is linked to more than one asset owner organisation an error may be returned and a further call is required to set the organisation for the current authentication session.\n\n\n<pre>\r\nURL: https:\/\/smarterwx.1100.com.au\/api\/community\/auth\/sessionorganisation\r\nHTTP Method: POST\r\nContent-Type: application\/json\r\nBody: { \"organisationId\": 123456 }\r\n<\/pre>\n\n\n--><\/p>\n<h4>API Details<\/h4>\n<p>The API is separated into a number of logical groupings described below. Access to each API method is based on your user role and some methods may not be available to you. This includes the fields that may be returned from an API call. The API documentation may show fields that are not returned when you use the API because your role does not allow it.<\/p>\n<h5>Community<\/h5>\n<p>Methods related to users, organisations and authentication.<\/p>\n<p><a href=\"\/help\/wp-content\/uploads\/2021\/05\/api-spec\/community.html\" target=\"_blank\" rel=\"noopener\">Documentation<\/a><\/p>\n<h5>Emails<\/h5>\n<p>Methods related to inbound and outbound emails.<\/p>\n<p><a href=\"\/help\/wp-content\/uploads\/2021\/05\/api-spec\/emails.html\" target=\"_blank\" rel=\"noopener\">Documentation<\/a><\/p>\n<h5>Enquiries<\/h5>\n<p>Methods related to enquiries, referrals and responses.<\/p>\n<p><a href=\"\/help\/wp-content\/uploads\/2021\/05\/api-spec\/enquiries.html\" target=\"_blank\" rel=\"noopener\">Documentation<\/a><\/p>\n<blockquote><p>For details on how to automate the lodging of enquiries, <a href=\"https:\/\/smarterwx.1100.com.au\/help\/article\/automating-enquiry-lodgement\/\">please refer to this article<\/a>.<\/p><\/blockquote>\n<h5>System<\/h5>\n<p>Methods related to files, field formats and system level operations.<\/p>\n<p><a href=\"\/help\/wp-content\/uploads\/2021\/05\/api-spec\/system.html\" target=\"_blank\" rel=\"noopener\">Documentation<\/a><\/p>\n<hr \/>\n<p>The same API calls are used by the web application itself. We recommend reviewing calls made between the browser and the server to understand how to use the APIs in your application. You should only use API methods described in the documentation. Other methods used by the application but not included in this documentation may be changed or removed at any time.<\/p>\n<blockquote><p>All use of the BYDA referral service API is based on a fair use policy. Rate limits and other technical limitations are implemented to protect the integrity of the service and may be changed at any time. API credentials may be revoked or temporarily blocked where the calling application could have a negative impact on the service.<\/p><\/blockquote>\n","protected":false},"author":6,"featured_media":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","article-category":[9],"article-tag":[],"class_list":["post-48","article","type-article","status-publish","format-standard","hentry","article-category-developers"],"_links":{"self":[{"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":11,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article\/48\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article\/48\/revisions\/492"}],"wp:attachment":[{"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article-category?post=48"},{"taxonomy":"article-tag","embeddable":true,"href":"https:\/\/smarterwx.1100.com.au\/help\/wp-json\/wp\/v2\/article-tag?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}