openapi: 3.2.0 info: title: Reposit Power Market Node API description: 'Documentation for the Reposit Power Market API. Used by fleet.repositpower.com and related services. Please review our [versioning and support policy](https://gist.github.com/mleonard87/d5ed0a82760ceb75adc7df0d62bf9c31) before using the API. ' contact: url: https://www.repositpower.com/ email: api@repositpower.com version: 1.0.0 servers: - url: https://marketapi.repositpower.com/ tags: - name: Node description: API end-points related to deployments. paths: /api/nodes: get: tags: - Node summary: All Nodes description: Return basic information and URLs on how to obtain more information about nodes. Each URL can also be expanded in place using the `expand` URL parameter parameters: - name: expand in: query description: 'Any property that contains a URL path rather than data can be expanded in place using the expand query string parameter. This is a CSV list of each property name which should be expanded. e.g. `?expand=network,address` ' schema: type: string responses: 200: description: OK content: application/json: schema: type: object Default response: example: data: - address: /api/nodes/bdeea25eb01b460da11e9208007ec2e5/address id: bdeea25eb01b460da11e9208007ec2e5 network: /api/nodes/bdeea25eb01b460da11e9208007ec2e5/network status: /api/nodes/bdeea25eb01b460da11e9208007ec2e5/status namePlate: /api/nodes/bdeea25eb01b460da11e9208007ec2e5/namePlate - address": /api/nodes/521444180bee43bda8e51ffe8a64c9bc/address id: 521444180bee43bda8e51ffe8a64c9bc network: /api/nodes/521444180bee43bda8e51ffe8a64c9bc/network status: /api/nodes/521444180bee43bda8e51ffe8a64c9bc/status namePlate: /api/nodes/521444180bee43bda8e51ffe8a64c9bc/namePlate status: OK Fully Expanded Response (?expand=address,network,status,system): example: data: - address: city: Canberra country: Australia lat: -35.333502 lng: 149.170508 postcode: '2609' state: ACT street: Yallourn Street street_number: 17/2 id: bdeea25eb01b460da11e9208007ec2e5 network: nmi: '10000200030' status: operationalStatus: lastTimestamp: 1505695466 lastValue: 0 ping: lastTimestamp: 1505695468 namePlate: batteryCapacity: 6.4 inverterPower: 3 batteryPower: 2 status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/nodes/{nodeId}/address: get: tags: - Node summary: Address/Location Info description: Return full address and lat/long information of a node. parameters: - name: nodeId in: path description: The ID of the node. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: city: Turner country: Australia lat: -35.26671 lng: 149.12879 postcode: '2612' state: ACT street: Macleay St street_number: '52' status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/nodes/{nodeId}/network: get: tags: - Node summary: Network Info description: Returns the NMI for this node. parameters: - name: nodeId in: path description: The ID of the node. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: nmi: 4102000000 status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/nodes/{nodeId}/status: get: tags: - Node summary: Operational Status description: Returns the latest operational status information for this node. parameters: - name: nodeId in: path description: The ID of the node. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: operationalStatus: lastTimestamp: 1505189841 lastValue: 0 ping: lastTimestamp: 1505189845 status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/nodes/{nodeId}/namePlate: get: tags: - Node summary: Name Plate description: Returns information about the energy system attached to this node. parameters: - name: nodeId in: path description: The ID of the node. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: batteryCapacity: 6.4 inverterPower: 3 batteryPower: 2 status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/nodes/{nodeId}/events: get: tags: - Node summary: Name Plate description: Returns events and changes in state to this node sorted by time descending. This will only return the first 100 results by default, as the number of results can be quite large. Therefore you must use the `limit` and `offset` parameters as specified below to retrieve either all results, or a page at a time. This endpoint only returns basic information; more details can be retrieved from the endpoint specific to that event type, e.g. from `/api/dispatches` parameters: - name: nodeId in: path description: The ID of the node. required: true schema: type: string - name: offset in: query description: An integer to offset the results by - to use for paging through the total results. If limit is specified, this is set to 0 by default. schema: type: number - name: limit in: query description: An integer to limit the results by - to use for paging through the total results. By default this is 100, or the maximum number of results (whichever is lower). schema: type: number responses: 200: description: OK content: application/json: schema: type: object example: data: - description: Network Support duration: 3600 eventType: DISPATCH id: b02067ae-d274-4d75-a00b-81a78184e987 ts: 1523430000 - description: Network Support duration: 3600 eventType: DISPATCH id: 64948b88-7af5-49a7-9b04-e0055419eaf8 ts: 1517547600 - description: The Reposit System was commissioned. eventType: COMMISSIONED ts: 1511204358 meta: count: 6 previous: https://marketapi.repositpower.com/api/nodes/5b0a63855f2f4f819ccda226ca9d14e8/events?limit=3&offset=0 status: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] components: securitySchemes: AccessToken: type: apiKey description: 'To authenticate you need to generate an API Key using Reposit Fleet. API Keys can be limited to whitelisted origin IP addresses for security and do not expire making them more suitable to server-to-server comms. API keys may also be revoked via Reposit Fleet. ### Creating an API Key API keys for the Reposit Market API can be generated by first logging in to [Reposit Fleet](https://fleet.repositpower.com). Once you have logged in click your username at the top right and then select "[User Settings](https://fleet.repositpower.com/user/settings)" Within the section labelled "API Keys" click the "Add API Key" button. Within the dialog that appears you will be able to name the key you are generating and specify a whitelist of IP addresses that this token is valid for. You will also need to confirm your password. When you have configured your keys settings click "Add" and your newly created key will be displayed - the key itself is not stored by Reposit and therefore this is your only opportunity to save the key securely. **Note**: The generated key authenticates as the account that you are currently logged in to Reposit Fleet for and as such will carry the same permissions. If you require a locked down account it is recommend that you create a new account for Reposit Fleet and generate the API Key for this account. ### Using an API Key Simply add `Bearer ` followed by the API key in the `Authorization` header of any request to Market API. e.g.: `Authorization: Bearer A2YWQiLCJpc3...` ### Revoking an API Key If an API Key becomes lost or is no longer required then the API Key can be revoked. Login to Reposit Fleet as the user for which you wish to revoke the API Key and proceed to [User Settings](https://fleet.repositpower.com/user/settings). From within the "API Keys" you will be able to see a table of all issued API Keys, find the API Key you wish to revoke and select the "Remove" link in the table. Once an API Key is removed it will cease to work immediately and can not be recovered or reinstated. ' name: Bearer in: header