Obtaining a token for Patchworks API authentication
Introduction
Patchworks API requests must be authenticated with a bearer token. To obtain a token, you need to send a login request which includes credentials that you use to access the Patchworks dashboard.
The steps
Step 1 Create a POST request for the following endpoint:
This endpoint is for the Patchworks production environment.
Step 2 In the request body, add the email and password that you use to log into the Patchworks dashboard. You should add this as JSON - for example:
![](https://doc.wearepatchworks.com/~gitbook/image?url=https%3A%2F%2F2440044887-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FLYNcUBVQwSkOMG6KjZfz%252Fuploads%252FTps7FWsKxFmi3p9FUYbe%252Flogin%2520request%25201.png%3Falt%3Dmedia%26token%3D89cc756e-9c14-4d27-b011-2dacaa817556&width=768&dpr=4&quality=100&sign=8a34abd2&sv=1)
Step 3 Send the request - if successful, a token is returned. For example:
![](https://doc.wearepatchworks.com/~gitbook/image?url=https%3A%2F%2F2440044887-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FLYNcUBVQwSkOMG6KjZfz%252Fuploads%252FMy0ppDJcJ9whuOsggR0e%252Flogin%2520request%25202.png%3Falt%3Dmedia%26token%3Dd7157204-efa5-40e6-b3a6-11447b65a8ea&width=768&dpr=4&quality=100&sign=4cdba04d&sv=1)
Access tokens are valid for 24 hours - for example: Issued: Wednesday 20th July at 10:03:08 GMT Expires: Tuesday 21st July at 10:03:08 GMT
Step 4 Save this token ready for use in your API requests.
Last updated