If your Surveypal organization is created before 31.08.2022 then you can use also API key for authentication.
Basic authentication is combination of your email address (Surveypal user name) and API key.
Basic authentication user name
This is your Surveypal user name, for example test.account@surveypal.com
Basic authentication password
- Select your name from the bottom left corner on the Surveypal front page
- Select 'Your account'.
- Select tab 'API keys'
- Create your first token by clicking 'Create key'
- Give your API key a name and click 'Create'
- Combine text "token-" and your API key
For example if API key is "AA_HvXX0A1Y1X11113ZV3v11cXX" then Basic Auth password is
token-AA_HvXX0A1Y1X11113ZV3v11cXX
How to generate Authorization header
Authorization header format:
Authorization: Basic USERNAME:PASSWORD
Take your user name and password and combine these like this:
username:password
For example
test.account@surveypal.com:token-AA_HvXX0A1Y1X11113ZV3v11cXX
and encode this with Base64. You can use text editor like Notepad++ or some service like https://www.base64encode.org/
Above username and password Base64 encoded:
dGVzdC5hY2NvdW50QHN1cnZleXBhbC5jb206dG9rZW4tQUFfSHZYWDBBMVkxWDExMTEzWlYzdjExY1hY
Add authorization header to your request
Now when you have encoded Basic Auth key, just add it to your request header like this
Authorization: Basic dGVzdC5hY2NvdW50QHN1cnZleXBhbC5jb206dG9rZW4tQUFfSHZYWDBBMVkxWDExMTEzWlYzdjExY1hY