Using Tokens - Examples
The Token use itself is very simple - in the place where you would usually use the password, you just use the Token itself.
Nevertheless here are some examples in different languages.
The Example
Jira
The API call we'll use as an example in Jira is
This gives you profile information about the currently logged-in User (in our case the User associated with the token).
A result looks like this:
More details in the Atlassian Jira REST Documentation: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/myself
Confluence
For Confluence the respective call would be:
This gives you profile information about the currently logged-in User (in our case the User associated with the token).
A result looks like this
More details in the Atlassian Confluence REST Documentation: https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#user-getCurrent
Bearer Auth header
Since version 1.7.0 you can also use a token as bearer token.
The difference is that instead passing type "Basic" you need to specify "Bearer" and you can omit the username and pass the token directly.
cURL Example

Basic Auth header
Most of the following examples will use the basic auth header. The Basic auth header looks like this:
Its value is simply a Base64-encoded representation of "username:password", in our case that would be "<username>:<your-api-token> (like when you place credentials in the URL directly).
There are a variety of website to generate this manually for Lab use like: https://www.blitter.se/utils/basic-authentication-header-generator/
Here are also many examples for different Languages: https://gist.github.com/brandonmwest/a2632d0a65088a20c00a
cURL Example

Ruby
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
Python
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
node.js
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
Java
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
PHP
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
GO
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
Service Now RESTMessageV2
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>
PHP - Wordpress 
Replace in the below:
- https://YOUR_JIRA_BASEURL/rest/api/2/myself
- <YOUR_BASIC_AUTH_HEADER>