Skip to content

Commit d6db74b

Browse files
authored
Update Readme with authentication
1 parent aa1c93b commit d6db74b

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,71 @@
1-
# epilotapi
1+
# Epilot Python SDK
2+
3+
Epilot is the digital foundation for sales, service, network and implementation processes in the context of the energy transition. This SDK is for the Epilot Journey, Entity and Automation APIs. Please see the Epilot developer documentation for more information.
24

35
<!-- Start SDK Installation -->
46
## SDK Installation
57

68
```bash
79
pip install epilotapi
810
```
11+
12+
## Authentication
13+
14+
To call epilot APIs, requests must be authorized using a valid Access Token.
15+
16+
### Using Access Token Authorization
17+
The access token should be passed in the Authorization request header.
18+
19+
```bash
20+
Authorization: Bearer <your-access-token>
21+
```
22+
23+
### Creating Access Tokens
24+
Users logged into the epilot 360 portal can manage their Access Tokens from Settings > Access Tokens.
25+
26+
Creating access tokens requires the `token:create` permission.
27+
28+
Access Token API
29+
Authenticated users can generate long-term access tokens for 3rd party applications using the epilot Access Token API createAccessToken operation.
30+
31+
```bash
32+
POST /v1/access-tokens
33+
{
34+
"name": "Token for my application"
35+
}
36+
```
37+
Optionally, you can pass a list of Role IDs, to define the roles the access token will have access to. By default, the access token inherits the caller's roles.
38+
39+
```bash
40+
POST /v1/access-tokens
41+
{
42+
"name": "Postman Access Token",
43+
"assume_roles": ["123:owner"]
44+
}
45+
```
46+
Each Access Token generated via the API gets a generated a unique ID.
47+
48+
```bash
49+
// 201 - success
50+
{
51+
"id": "api_5ZugdRXasLfWBypHi93Fk",
52+
"created_at": "2019-08-24T14:15:22Z",
53+
"name": "Postman Access Token",
54+
"assignments": ["123:owner"]
55+
}
56+
```
57+
Access tokens may also be revoked using the revokeAccessToken operation
58+
```bash
59+
DELETE /v1/access-tokens/api_5ZugdRXasLfWBypHi93Fk
60+
// 200 - success
61+
{
62+
"id": "api_5ZugdRXasLfWBypHi93Fk",
63+
"created_at": "2019-08-24T14:15:22Z",
64+
"name": "Postman Access Token",
65+
"assignments": ["123:owner"]
66+
}
67+
```
68+
969
<!-- End SDK Installation -->
1070

1171
## SDK Example Usage

0 commit comments

Comments
 (0)