Skip to main content

Tokens reference

API tokens are used for the Edge Python API. They allow you to create an EdgeSession object and perform tasks like uploading and downloading files, use data connectors, and more. You can create and delete tokens using the "Edge API Tokens" section in your Profile.

# List tokens
[1]: edge.tokens.list()
[Token]

# Create a token
[2]: edge.tokens.create('This is my token')
<edge.edge_tokens.Token>

Constructor

Constructing these yourself is not recommended. You should make an EdgeSession and access the .tokens property.


Methods

list

list() -> list(Token)

Retrieves a list of Edge Tokens for the current user.

Returns

list(Token) List of Edge Tokens.


get

get(token_id) -> Token

Retrieves an Edge Token.

Parameters

  • token_id (str)
    The token's ID.

Returns

Token The object corresponding to the Token.


create

create(note=None, expires_in=None) -> Token

Creates an Edge Token.

Parameters

  • note (str)
    Optional; A descriptive note to attach to the token. This is not the ID of the token, only an optional description.
  • expires_in (int)
    Optional; The time to live of the created token, in seconds. If None is specified, the token will not expire until it is removed. If 0 is specified, the token will expire immediately. This may generate some errors during token creation.

Returns

edge.edge_tokens.Token An object where the token property is the value of the token.


remove

remove(token_id)

Removes an Edge Token.

Parameters

  • token_id (str)
    The token's ID.