### Atom Feed Example for Green Button Data Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Provides a complete example of an Atom feed structure as used in the Green Button API. This includes essential elements like , , , , <link>, and <entry>, demonstrating how to serialize energy usage information. ```XML <feed xmlns="http://www.w3.org/2005/Atom" xsi:schemaLocation="http://naesb.org/espi espiDerived.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <id>urn:uuid:728B5594-414E-471A-A230-08FCCDAC655C</id> <published>2012-10-24T00:00:00Z</published> <updated>2012-10-24T00:00:00Z</updated> <title>ThirdPartyX Batch Feed 2012-10-24T00:00:00Z urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 my house 0 ``` -------------------------------- ### UsagePoint Resource Example (XML) Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/index.html An example of a UsagePoint resource, which represents a point where a resource is measured, such as a utility smart meter. It includes links to related resources and application information. ```xml urn:uuid:af6e8b03-0299-467e-972a-a883ecdcc575 GreenButtonData.org DataCustodian Application https://services.greenbuttondata.org/ThirdParty/espi/1_1/Notification https://services.greenbuttondata.org/DataCustodian/espi/1_1/resource https://services.greenbuttondata.org/ThirdParty/Subscription/ScopeSelection secret https://services.greenbuttondata.org/ThirdParty/espi/1_1/OAuthCallBack third_party FB=4_5_15;IntervalDuration=900;BlockDuration=monthly;HistoryLength=13 FB=4_5_15;IntervalDuration=3600;BlockDuration=monthly;HistoryLength=13 data_custodian Third Party (localhost) 2014-01-02T10:00:00Z 2014-01-02T10:00:00Z ``` -------------------------------- ### ReadingType Resource Example (XML) Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/index.html An example of a ReadingType resource, which provides details about the specifics of meter reading data, including accumulation behavior, commodity type, and unit of measure. ```xml urn:uuid:99b292fc-55f7-4f27-a3b9-cddab97cca90 Type of Meter Reading Data 4 1 840 12 1 86400 12 769 0 0 72 2013-09-19T04:00:00Z 2013-09-19T04:00:00Z ``` -------------------------------- ### Example XML IntervalReading Data Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/index.html This snippet demonstrates the structure of an espi:IntervalReading element in XML format. It includes details such as cost, time period with duration and start timestamp, and the energy value. This format is common for representing energy consumption data. ```xml 256347 86400 1357794000 21021 ``` -------------------------------- ### Atom Feed Structure for Green Button Data Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html This snippet shows an example of an Atom feed used by the Green Button API. It demonstrates how energy usage data is structured using XML elements like ``, ``, and ``, and how relationships are defined using `` tags. The feed includes metadata and specific data points for a UsagePoint. ```xml urn:uuid:728B5594-414E-471A-A230-08FCCDAC655C 2012-10-24T00:00:00Z 2012-10-24T00:00:00Z ThirdPartyX Batch Feed 2012-10-24T00:00:00Z urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 my house 0 ``` -------------------------------- ### GET /DataCustodian/espi/1_1/resource/ApplicationInformation/ Source: https://context7.com/greenbuttonalliance/openespi-greenbutton-api-documentation/llms.txt Retrieves all registered application information structures from the Data Custodian. Requires Data Custodian Admin or similar authorization. ```APIDOC ## Application Information - Retrieve All Applications Retrieves all registered application information structures from the Data Custodian. ### Method GET ### Endpoint `/DataCustodian/espi/1_1/resource/ApplicationInformation/` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://sandbox.greenbuttonalliance.org:8443/DataCustodian/espi/1_1/resource/ApplicationInformation/" \ -H "Authorization: Bearer 2a85f4bd-30db-4b7d-8f41-b046b0566cb3" \ -H "Accept: application/atom+xml" ``` ### Response #### Success Response (200 OK) - **atom:feed** (feed) - A feed of ApplicationInformation entries, including OAuth client details. #### Response Example (Response is an Atom feed containing ApplicationInformation entries. Specific example not provided.) #### Error Responses - **202 Accepted**: The request has been accepted for processing but is not yet complete. - **400 Bad Request**: The request was malformed or invalid. - **403 Forbidden**: The authenticated user does not have permission to perform this action. ``` -------------------------------- ### Filter and Paginate API Results via cURL Source: https://context7.com/greenbuttonalliance/openespi-greenbutton-api-documentation/llms.txt Demonstrates how to use common query parameters with cURL to filter and paginate results from Green Button resource endpoints. This example shows filtering by publication and update dates, limiting results, and setting the start index for pagination. ```bash # Example with all common query parameters curl -X GET "https://sandbox.greenbuttonalliance.org:8443/DataCustodian/espi/1_1/resource/UsagePoint/?published-min=2023-01-01T00:00:00Z&published-max=2023-12-31T23:59:59Z&updated-min=2024-01-01T00:00:00Z&max-results=25&start-index=1&depth=5" \ -H "Authorization: Bearer 2a85f4bd-30db-4b7d-8f41-b046b0566cb3" \ -H "Accept: application/atom+xml" ``` -------------------------------- ### Green Button Atom Feed Structure Example Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/index.html Illustrates the basic structure of a Green Button Atom feed, showing how energy usage information is encapsulated within \'\' and \'\' tags. This format is used for representing resources like UsagePoints and MeterReadings. ```xml ... ... ... ``` -------------------------------- ### MeterReading API Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html A container for all measured IntervalBlocks at a UsagePoint. This endpoint is a placeholder for meter reading data. ```APIDOC ## GET /espi/1_1/resource/UsagePoint/{usagePointId}/MeterReading/{id} ### Description Retrieves meter reading data for a specific UsagePoint. ### Method GET ### Endpoint /espi/1_1/resource/UsagePoint/{usagePointId}/MeterReading/{id} ### Parameters #### Path Parameters - **usagePointId** (string) - Required - The identifier of the UsagePoint. - **id** (string) - Required - The unique identifier of the MeterReading. ### Response #### Success Response (200) - **MeterReading** (object) - An object containing meter reading details, potentially including IntervalBlocks. #### Response Example ```json { "MeterReading": { "interval": [ { "start": 1350975600, "duration": 86400, "value": 15000 } ] } } ``` ``` -------------------------------- ### UsagePoint Resource Representation (XML) Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Represents a usage point where a resource is measured, such as a smart meter or an electrical outlet. Includes service category information and links to related meter readings and summaries. ```xml urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 2012-10-24T00:00:00Z 2012-10-24T00:00:00Z my house 0 ``` -------------------------------- ### ApplicationInformation API Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Describes the relationship between a Data Custodian and a Third Party. Includes an ID, timestamps, and links to related resources. ```APIDOC ## GET /espi/1_1/resource/ApplicationInformation/{id} ### Description Retrieves details of a specific ApplicationInformation resource. ### Method GET ### Endpoint /espi/1_1/resource/ApplicationInformation/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the ApplicationInformation. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the ApplicationInformation. - **published** (datetime) - The publication timestamp. - **updated** (datetime) - The last updated timestamp. - **content** (object) - Contains the ApplicationInformation details. - **ApplicationInformation** (object) - **kind** (integer) - The kind of application information (e.g., 0 for a specific relationship type). #### Response Example ```json { "id": "urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1", "published": "2012-10-24T00:00:00Z", "updated": "2012-10-24T00:00:00Z", "content": { "ApplicationInformation": { "kind": 0 } } } ``` ``` -------------------------------- ### jQuery UI Menu Initialization Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Initializes a jQuery UI menu widget. This code snippet is straightforward and assumes the presence of a HTML element with the ID 'menu' and that jQuery and jQuery UI are loaded. ```javascript $( "#menu" ).menu(); ``` -------------------------------- ### Initialize Green Button Sandbox via JavaScript Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/API/reset.html This snippet demonstrates how to initialize the Green Button API sandbox by sending a GET request to the 'initializeDataCustodianDB' command. It uses the XMLHttpRequest object, similar to the reset function. Proper authentication and host configuration are necessary. ```javascript var xmlhttp = null; var initUrl = "http://sandbox.greenbuttonalliance.org:8443/DataCustodian/management?command=initializeDataCustodianDB"; function SendRequest (url) { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open ("GET", url, true); xmlhttp.setRequestHeader ("Accept", "*/*"); xmlhttp.setRequestHeader ("Authorization", "Bearer 688b026c-665f-4994-9139-6b21b13fbeee"); xmlhttp.setRequestHeader ("Content-type", "text/plain"); xmlhttp.withCredentials = true; xmlhttp.setRequestHeader ("Host", "sandbox.greenbuttonalliance.org:8443"); xmlhttp.onreadystatechange = OnStateChange; xmlhttp.send (null); } function OnStateChange () { alert("initialization accomplished"); } // To execute the initialization: // SendRequest(initUrl); ``` -------------------------------- ### ElectricPowerUsageSummary XML Structure Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Summarizes electric power usage over a billing period. It includes details like bill amounts, currency, and consumption values, providing a comprehensive overview of energy usage for billing purposes. ```xml urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 2012-10-24T00:00:00Z 2012-10-24T00:00:00Z my house 2588400 1330578000 20810000 8145000 4525000 840 0 72 1951364 0 1334462400 72 1006640 14 1334462400 ``` -------------------------------- ### UsagePoint API Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Represents a location where a resource is measured, such as a smart meter or an electrical outlet. It includes a ServiceCategory. ```APIDOC ## GET /espi/1_1/resource/RetailCustomer/{customerId}/UsagePoint/{id} ### Description Retrieves details of a specific UsagePoint for a given retail customer. ### Method GET ### Endpoint /espi/1_1/resource/RetailCustomer/{customerId}/UsagePoint/{id} ### Parameters #### Path Parameters - **customerId** (string) - Required - The identifier of the retail customer. - **id** (string) - Required - The unique identifier of the UsagePoint. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the UsagePoint. - **published** (datetime) - The publication timestamp. - **updated** (datetime) - The last updated timestamp. - **content** (object) - Contains the UsagePoint details. - **UsagePoint** (object) - **ServiceCategory** (object) - **kind** (integer) - The kind of service category (e.g., 0 for electricity). #### Response Example ```json { "id": "urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1", "published": "2012-10-24T00:00:00Z", "updated": "2012-10-24T00:00:00Z", "content": { "UsagePoint": { "ServiceCategory": { "kind": 0 } } } } ``` ``` -------------------------------- ### Authorization API Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Represents an authorization to exchange data. It includes a unique ID, publication and update timestamps, and a link to the resource. ```APIDOC ## GET /espi/1_1/resource/Authorization/{id} ### Description Retrieves details of a specific authorization. ### Method GET ### Endpoint /espi/1_1/resource/Authorization/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the authorization. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the authorization. - **published** (datetime) - The publication timestamp. - **updated** (datetime) - The last updated timestamp. - **content** (object) - Contains the Authorization details. - **Authorization** (object) - **kind** (integer) - The kind of authorization (e.g., 0 for data exchange). #### Response Example ```json { "id": "urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1", "published": "2012-10-24T00:00:00Z", "updated": "2012-10-24T00:00:00Z", "content": { "Authorization": { "kind": 0 } } } ``` ``` -------------------------------- ### jQuery UI Accordion Initialization Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Initializes a jQuery UI accordion widget. This code snippet demonstrates how to create a collapsible accordion with default settings. It requires the jQuery and jQuery UI libraries to be included in the project. ```javascript $(function() { $( "#accordion" ).accordion({ collapsible: true, active: false }); }); ``` -------------------------------- ### jQuery UI Tabs Initialization Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Initializes a jQuery UI tabs widget. This code snippet assumes a HTML structure suitable for tabs is present and that the jQuery and jQuery UI libraries are loaded. ```javascript $(function() { $( "#tabs" ).tabs(); }); ``` -------------------------------- ### OData Relationships and Atom Structure Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Explains how OData uses XML tags like ``, ``, and `` to represent relationships and data entries within the Green Button API. ```APIDOC ## OData Relationships and Atom Structure ### Description OData uses the `` tag to represent relationships between data entities, providing an alternative to traditional hierarchical XML structures. The `` tag represents a data row, and the actual data is often found within the `` tag or an associated `` entity. An `` serves as a container for these entries. ### Key Tags - **``**: Represents relationships between data entities (e.g., UsagePoint to MeterReading). - **``**: Represents a single data record or row. - **``**: Contains the actual data payload for an entry. - **``**: A container for multiple entries, often representing a collection of related data. - **``**: The unique identifier (UUID) of an entity. - **``**: A human-readable description of an entity. - **`<published>`**: The publication date of the feed or entry. - **`<updated>`**: The last updated date of the feed or entry. ### Example of Link Representation *Hierarchical XML Structure (Conceptual):* ```xml <UsagePoint> <link rel="self" href="/espi/RetailCustomer/{RetailCustomerID/UsagePoint/{usagePointId}" /> <MeterReading> <IntervalBlock> ... </IntervalBlock> ... </MeterReading> ... </UsagePoint> ``` *OData Representation using `<link>` tag:* ```xml <entry> <link rel="self" href="/espi/RetailCustomer/{retailCustomerId/UsagePoint/{usagePointId}/MeterReading/{meterReadingId}" /> <link rel="related" href="/espi/RetailCustomer/{retailCustomerId/UsagePoint/{usagePointId}" /> <content> <MeterReading> ... </MeterReading> </content> </entry> <entry> ... <link rel="self" href="/espi/RetailCustomer/{retailCustomerId/UsagePoint/{usagePointId}/MeterReading/{meterReadingId}/IntervalBlock/{intervalBlockId}" /> <link rel="related" href="/espi/RetailCustomer/{retailCustomerId/UsagePoint/{usagePointId}/MeterReading/{meterReadingId}" /> <content> <IntervalBlock> ... </IntervalBlock> </content> </entry> ``` ### Atom Containers Overview - **`<feed>`**: Contains metadata about the data feed and a collection of entries. The `<description>` within the feed provides a human-readable summary. - **`<title>`**: Typically contains the description of the Green Button entity. - **`<id>`**: Contains the entity's UUID. - **`<link>`**: Defines relationships and navigation links. - **`<entry>`**: Represents a single data record. ### Full Feed Example ```xml <feed xmlns="http://www.w3.org/2005/Atom" xsi:schemaLocation="http://naesb.org/espi espiDerived.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <id>urn:uuid:728B5594-414E-471A-A230-08FCCDAC655C</id> <published>2012-10-24T00:00:00Z</published> <updated>2012-10-24T00:00:00Z</updated> <title>ThirdPartyX Batch Feed 2012-10-24T00:00:00Z urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 my house 0 ``` ``` -------------------------------- ### ApplicationInformation Resource Representation (XML) Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Describes application information related to data custodian and third-party relationships in the Green Button API. It includes standard entry elements and an ApplicationInformation content block. ```xml urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 2012-10-24T00:00:00Z 2012-10-24T00:00:00Z ApplicationInformation Describing a DataCustodian and ThirdParty relationship 0 ``` -------------------------------- ### XML Representation of IntervalBlock Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/index.html This XML snippet demonstrates the structure of an IntervalBlock, a core data element in Green Button data. It includes links for navigation, a title, and the content which contains interval details (duration, start time) and multiple IntervalReadings, each with its own time period and value. ```xml urn:uuid:e0383570-16b1-4ab9-8642-fdb7e89660db 2678400 1357016400 256347 86400 1357016400 21021 256347 86400 1357102800 21021 256347 86400 1357189200 21021 256347 86400 1357275600 21021 203931 86400 1357362000 25662 203931 86400 1357448400 25662 256347 86400 1357534800 21021 256347 86400 1357621200 21021 256347 86400 1357707600 21021 ``` -------------------------------- ### Configure OAuth2 Access Token in JavaScript for Swagger UI Source: https://context7.com/greenbuttonalliance/openespi-greenbutton-api-documentation/llms.txt Configures Swagger UI to use OAuth2 Bearer tokens for authentication in JavaScript. This example demonstrates how to dynamically add an authorization header with a token upon successful Swagger UI loading. It lists available sandbox tokens for different roles. ```javascript // JavaScript example: Setting up Swagger UI with access token window.swaggerUi = new SwaggerUi({ url: "/OpenESPI-GreenButton-API-Documentation/API/api-docs", dom_id: "swagger-ui-container", onComplete: function(swaggerApi, swaggerUi) { // Add OAuth2 authorization header var token = "Bearer 2a85f4bd-30db-4b7d-8f41-b046b0566cb3"; window.authorizations.add("oauth2", new ApiKeyAuthorization("Authorization", token, "header") ); } }); // Available sandbox tokens: // Data Custodian Admin: Bearer 2a85f4bd-30db-4b7d-8f41-b046b0566cb3 // Meter Upload Admin: Bearer 03909715-b0ca-4797-9a9a-601fff1d2848 // Third Party Admin: Bearer 53520584-d640-4812-a721-8a1afa459ff7 // Registration Admin: Bearer c66b0854-ea1f-4e24-afb7-afab9e0f6c5e // User alan (SubID=5): Bearer f48223ce-92f5-4a41-9028-1a370eb102c5 // User charles (SubID=6): Bearer ae3e7cba-6478-444a-978c-7505d52034a0 ``` -------------------------------- ### GET /resource/?published-min={date}&published-max={date}&updated-min={date}&updated-max={date}&max-results={long}&start-index={long}&depth={long} Source: https://context7.com/greenbuttonalliance/openespi-greenbutton-api-documentation/llms.txt All Green Button resource endpoints support standard query parameters for filtering results by date ranges and controlling pagination. ```APIDOC ## API Query Parameters - Filtering and Pagination All Green Button resource endpoints support standard query parameters for filtering results by date ranges and controlling pagination. ### Method GET ### Endpoint `/resource/` (Applies to various resource endpoints, e.g., `/UsagePoint/`) ### Parameters #### Path Parameters None #### Query Parameters - **published-min** (string) - Optional - Filter by published date (ISO 8601 format, e.g., `YYYY-MM-DDTHH:MM:SSZ`). - **published-max** (string) - Optional - Filter by published date (ISO 8601 format). - **updated-min** (string) - Optional - Filter by last update date (ISO 8601 format). - **updated-max** (string) - Optional - Filter by last update date (ISO 8601 format). - **max-results** (long) - Optional - Maximum number of entries to return in the response. - **start-index** (long) - Optional - One-based offset for pagination, determining the starting entry. - **depth** (long) - Optional - Maximum depth of related resources to include in the response. ### Request Example ```bash curl -X GET "https://sandbox.greenbuttonalliance.org:8443/DataCustodian/espi/1_1/resource/UsagePoint/?published-min=2023-01-01T00:00:00Z&published-max=2023-12-31T23:59:59Z&updated-min=2024-01-01T00:00:00Z&max-results=25&start-index=1&depth=5" \ -H "Authorization: Bearer 2a85f4bd-30db-4b7d-8f41-b046b0566cb3" \ -H "Accept: application/atom+xml" ``` ### Response #### Success Response (200 OK) - **atom:feed** (feed) - Returns filtered and paginated results in an Atom feed format. #### Response Example (Response includes filtered and paginated results. Specific example not provided.) ``` -------------------------------- ### IntervalBlock XML Structure Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/TermsOfUse.html Represents a block of energy usage data, containing one or more intervals with start times, durations, and readings. This structure is fundamental for carrying energy usage information. ```xml urn:uuid:97EAEBAD-1214-4A58-A3D4-A16A6DE718E1 2012-10-24T00:00:00Z 2012-10-24T00:00:00Z my house 86400 1330578000 539919 86400 1330578000 57751 ``` -------------------------------- ### Initialize Swagger UI with Authorization Source: https://github.com/greenbuttonalliance/openespi-greenbutton-api-documentation/blob/gh-pages/Screens/index.html This JavaScript code initializes the Swagger UI for the Green Button API. It sets up the API documentation endpoint, includes callbacks for loading and failure, and configures authorization using an access token. The code also demonstrates how to dynamically update the authorization token from an input field. ```javascript window.onload = function() { window.ui = SwaggerUIBundle({ url: "/OpenESPI-GreenButton-API-Documentation/API/api-docs", dom_id: "#swagger-ui", deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIExpandCollapse ], plugins: [ SwaggerUIExpandCollapse ], layout: "BaseLayout", onComplete: function() { if(console) { console.log("SwaggerUIBundle loaded successfully") } // Highlight code blocks after Swagger UI is loaded document.querySelectorAll('pre code').forEach((block) => { hljs.highlightBlock(block); }); }, onFailure: function(data) { if(console) { console.log("Unable to Load SwaggerUIBundle"); console.log(data); } }, docExpansion: "none" }); }; $(function () { // Existing SwaggerUi initialization (if not using SwaggerUIBundle) window.swaggerUi = new SwaggerUi({ url: "/OpenESPI-GreenButton-API-Documentation/API/api-docs", dom_id: "swagger-ui-container", onComplete: function(swaggerApi, swaggerUi){ if(console) { console.log("Loaded SwaggerUI") } $('pre code').each(function(i, e) { hljs.highlightBlock(e); }); }, onFailure: function(data) { if(console) { console.log("Unable to Load SwaggerUI"); console.log(data); } }, docExpansion: "none" }); // Handle Access Token input change $('#input_accessToken').change(function() { console.log("Handler for Access Token .change() called..."); var token = $('#input_accessToken')[0].value; console.log("input: " + token); if(token && token.trim() != "") { console.log("Access Token: " + token); window.authorizations.add("oauth2", new ApiKeyAuthorization("Authorization", token, "header")); } }); // Initial authorization with a default token var token = "Bearer ae4e33b9-457d-43b4-8815-856b6c8b7a72"; window.authorizations.add("oauth2", new ApiKeyAuthorization("Authorization", token, "header")); // Load Swagger UI window.swaggerUi.load(); }); ```