All requests to MachShip API require a valid API token. This token can be generated by logging in to MachShip and adding a new token to your user account.
How to Create an API Token
The My API Tokens option lets users create/generate their own API token on their login page in MachShip.
On the top right corner of your screen, click on the cog button and select My API Tokens
You will then be navigated to the My Api Tokens Page and to create, click on Create API Token button.
You will see a pop-up dialog box like the below image:
You will need to type in a Token Name. Note that it needs to be unique as it will be a way for MachShip to identify and show up in the history logs.
Click on Create Token button to generate the API Token.
If you see the sample error message from the below screenshot, it means the name is already taken and that you will need to enter another name.
When the token is generated successfully, you will see a green prompt in the top right corner of the screen.
You can copy the Token by highlighting the text field and press ctrl + C buttons or click on the blue clip board icon to automatically copy the token.
Note: You will need to note down the generated API Token and store the token value for safekeeping as it's Read Only and you will not be able to view the Token value again, else, you will need to re-generate a new API Token.
Once copied, you are ready to connect to the MachShip API.
How to Revoke an API Token
Users have the ability to revoke access to the MachShip API.
On the same page under My API Tokens, you will see a list of all created API tokens and their current status.
To revoke access of the created user API token to theMachShip API, simply click on the the drop-down cogbutton on the right corner and select Revoke API Token.
This will prompt the Revoke User Api Token modal to appear, whereby you will need to confirm if you wish to revoke the Token access. Select Revoke User Api Token button to confirm.
The token will then be revoked and the Date Revoked column will be populated with the revoked date.