Skip to content

Commit

Permalink
docs: Update REST API guide
Browse files Browse the repository at this point in the history
  • Loading branch information
keydunov committed Apr 23, 2019
1 parent cdfcd87 commit 9c52dc8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/Cube.js-Backend/REST-API.md
Expand Up @@ -9,11 +9,19 @@ menuOrder: 2
### Base path

REST API is used to communicate with Cube.js backend.
All requests are prefixed with **basePath** described in [Backend Server Core](/@cubejs-backend-server-core). By default it's `/cubejs-api`.
All requests are prefixed with **basePath** described in [Backend Server Core](@cubejs-backend-server-core). By default it's `/cubejs-api`.

### Authentication

You need to pass your API Token in Authorization Header. How to generate API Tokens is described in [Security section](/security). In Development environment a temporary API Token is generated on every launch and printed into terminal.
Cube.js uses API Token for requests' authorization and also for passing
additional user context, which could be used in [USER_CONTEXT](cube#context-variables-user-context) object in the Data
Schema.

The API Token is passed via the Authorization Header. The token itself is a [JSON
Web Token](https://jwt.io), the [Security section](security) describes how to generate it.

In the development environment the token in not required for authorization, but
you can still use it to pass a user context.

### Example request

Expand Down Expand Up @@ -223,4 +231,4 @@ Example response:
}
]
}
```
```

0 comments on commit 9c52dc8

Please sign in to comment.