There are two methods to authenticate the GoCanvas API (application program interface). By default, each call placed to the API accepts the username and password of an authorized GoCanvas user as required parameters. The second option is to set up an API Key at the account or department level and pass a token inside the header of your request with a username as the parameter.
Configuring API Keys
To enable the API Key feature and create an API Key, follow these steps:
- Go to Account > Account Settings.
- Scroll down to the Security Settings > API Keys and click Settings.
- On this page, check the box to Enable API Keys and then click Create API Key. (Note: If you utilize Departments in your account, you will specify which Department the API Key is associated with upon creating the API Key. If you choose "All", the token will have access to all Department data.)
- Enter a Key Name and click Save.
- GoCanvas will generate a unique API Key that you must copy and store somewhere safe to use in your API calls (Note: Characters will not be blurred as seen in this image).
Once you have created the API Key, you will use API calls by passing the token inside the header of your request. The username parameter is mandatory, otherwise a "Permission Denied for the requested resource" error will be returned by the API calls. When you use API Keys, you'll no longer be able to access the API (including Zapier and Business Insights) with just your username and password.
Curl Request Format:
curl -H "Authorization: Bearer NapDjG*****************************************" localhost:3000/apiv2/forms.xml -F 'username=test_user@gocanvas.com'
HTTP Request Format:
Request Headers:
Authorization:"Bearer NapDjG**************************************"
Request Body:
username:" test_user@gocanvas.com"
Comments
0 comments
Please sign in to leave a comment.