One of the most common errors that Developers run into when first starting to work with the AccountRight API looks something like this
[
{
"Message": "Access denied"
}
]
Great news, this one is rather easy to solve!
The cause of the `Acces denied` error always comes down to one of two things;
- The `cftoken` header is missing from the request.
- The wrong details are being passed in the `cftoken`.
The data that is passed in the `cftoken` header relates to the company file sign in details for the AccountRight file that you are trying to connect to.
These details are always passed base64 encoded as the username and password. For example with our sandbox files, we keep an `Administrator:` (blank password) login for you to use.
If you are not sure of the company file sign in details that you should be passing in the `cftoken`, you will need to talk to the client that sent you the invite.
In many cases, the client will have 'linked' their login details (that's step 6 of Open a company file). If a client has linked their login then you don't need to provide that header.
If they haven't then you'll need to prompt them for which file user they want to log in as and then pass their credentials in the cftoken header.
For AccountRight, the workflow that we recommend you follow is:
- Complete Oauth
- Choose the file you're connecting to
- Attempt to GET /CurrentUser endpoint.
If you get a permission error then prompt the user for their cftoken credentials.
Or it's successful then the client must have linked their login and you don't have to do anything else.
Comments
0 comments
Article is closed for comments.