Skip to content

Create an access token

  1. Determine if you want a user or application token, since all the actions made with the token are done by the “user” who created it.

  2. For a user token, you can proceed with the steps below. For an application token, please contact our support team who will provide you with a dedicated account for your application.

Access token

Create an access token

Currently the only way to create an access token is to use the API of the instances.

  1. Sign-in with the application credentials, and get the bearer token of the user.
Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/sign-in' \
--header 'Content-Type: application/json' \
--data-raw '
{"username":"{ YOUR EMAIL }","password":"{ YOUR PASSWORD }"} | jq -r '.token'
  1. Create the access token for the user.
Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/access-token/user/{ USER_ID }' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer { BEARER_TOKEN }' \
--data '{
"name": "{ APPLICATION_NAME }"
}'
  1. Store the access token somewhere safe, and use it to make the actions.

Use the access token

To use the access token, you will need to add the header X-ACCESS-TOKEN with the value of the access token.

for example to request the list of briefs:

Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/briefs?page=1&limit=25 sort=code%2CDESC' --header 'X-ACCESS-TOKEN: { YOUR ACCESS TOKEN }'

Bearer token

You can use the bearer token to make the API calls but we highly recommend using the access token to avoid issues with the token expiration.

Create an access token

  1. Sign-in with the application credentials, and get the bearer token of the user.
Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/sign-in' \
--header 'Content-Type: application/json' \
--data-raw '
{"username":"{ YOUR EMAIL }","password":"{ YOUR PASSWORD }"} | jq -r '.token'
  1. Store the bearer token somewhere safe, and use it to make the actions.

Use the bearer token

To use the bearer token, you will need to add the header Authorization with the value of the bearer token.

for example to request the list of briefs:

Terminal window
curl --location 'https://{ YOUR INSTANCE }-hipe.packitoo.com/api/briefs?page=1&limit=25&sort=code%2CDESC' \
--header 'Authorization: Bearer { YOUR BEARER TOKEN }'