Impersonating a user
To utilize the Expense API, all requests need to be done on behalf of a user. The access token needs to be created based on a user.
First of all, you need to have an API key with full access to your client application. This key also needs to have the role to generate a user authorization code. We will show the steps below in Postman. For url and host reference see this article.
- Use this endpoint with your Client ID and Secret to get an access token. This is your integration key.
- With the above generated access token send a request to this endpoint with the user_id of the user you want to perform actions as. You will get an authorization code in return. To get user_id check out this article.
- The last step is to exchange the user code for an access token. There is no need to provide the access token in this request.
Cool, now you can use this access token to list expenses, create mileages etc as this user.
Updated 18 days ago