Exporting PDF via RESTMessageV2 API with a basic authentication fails with HTTP 401 error.
Below are steps to be followed:
- Go to rest message and select the associated REST message.
- Set the authentication type "Basic" and set the Basic Auth Profile with the name in "sys_auth_profile_basic" table.
- Click on "TEST" under the related list in the HTTP method such as POST under related link, click "Test".
- Test run fails with below error:
Method failed: (/xxxxxx.do) with code: 401 - Invalid username/password combo
Release or Environment
This HTTP status 401 may have been caused by below reasons:
- The Basic Auth record in "sys_auth_profile_basic" may not have the right username and password credentials
- The username may not be existing in the "sys_user" table
To overcome this error ; the value in the username field in the "sys_auth_profile_basic" which is associated with the REST message Basic Auth Profile should also be checked if the username is existing on the sys_user table.
If not , please add the username to sys_user table with providing "web_service_admin" role to that username. Below is the documentation to follow :