Using Postman:
I can use Post and get an authorization token, but when I create the Get with Authorization = AnaplanAuthToken <token from Post>
Content-type=application/json
Basic Authentication
and workspace ID and Model Id in URL
https://api.anaplan.com/2/0/workspaces/<workspace id>/models/<model id>
I get:
{
"status": {
"code": 401,
"message": "Not Authorized."
}
}
Any ideas?
Solved! Go to Solution.
Hi @stephen.hoffer,
The endpoint you used isn't valid for the 2.0 API, fetching model data is now under https://api.anaplan.com/2/0/users/<workspaceId>/models/<modelId>
For further details, please check our 2.0 API guide.
Regards
I just retooled the URL as per your post and the same result.
Hi @stephen.hoffer,
Apologies for the mixup on my part, after /users/ it should be your user ID, not workspace. You can obtain this by sending a GET request to https://api.anaplan.com/2/0/users/me
Once you have your ID, the URL for model details is
https://api.anaplan.com/2/0/users/<user ID>/models/<model ID>
Regards
Interestingly enough, I still cannot get anything my code 401.
I can still Post https://auth.anaplan.com/token/authenticate with password and Basic Authentication and get SUCCESS.
But any get still gives 401.
I have admin to Anaplan proper and can get into any of my models, so that is absolutely not an issue.
It seems odd that I can authenticate via Post and get the Token, but cannot get beyond that point.
Posting a GET to https://api.anaplan.com/2/0/workspaces/{ID}/models/{ID}/exports
is working fine for me. I'll try it without the /exports later if I get time.
For a GET your headers should be
There should only be a Content-Type header on POST – not sure if that's making a difference.
I take it you're getting a fresh token often enough too? Though I think the message is specific about expired tokens.
Could you share a screenshot of your request, including the full Authentication header, to help troubleshoot?
The Auth Token was copied from the authentication POST and the Get was run right afterward
GET
https://api.anaplan.com/2/0/workspaces/8a81b09c652b03b101654519bfe258d4/models/5D597B7A61B94E9EBB127... RT6nJJlsp7Ob421uHl0GHg==.qMbCcIlo5Sf72aVROHBDCKMkmvDg222STZdl4/o7Lm7OFjlvNUqrYwGvVZZFtmGr+FOZmEJ5Tt9Hno2gHaEN7Hnrn420EWz8+kDOnBKgPLQ5Nk937YqujcP/+Yr/RifwvNfwF6EKV7CkaQwZoaSa0ohDpdXfPcz9nbbJEzce3Q/kpAGyHjE1E6AzU1X0kJ7yzmDUcxpfm2qStCwUqiARoAo3oKGDAA+ikPLFN5KiFQdsFluQGy3hk+Jj93DXl7gBdOHUNvkZhqEFhZDxoY9m+he25aWTJF1JCZLXlgENTdPb5ZQ6AWBVZhGk7k68av5ydM7l86lF4xZVeDrsVBfViI6gwzFSDfrB0+TeWMzRCRT7iJXpCZTeQMyLp4FkqgahcAtG8Z+dimv6gfsGDwvow1NBhfdzNisUHcGjQzaG8Pl1oT8bA/pxEF5+m76Cl3018Wbuj3eU4gOvehSKe8PryA==.iimhxvndXKdDTITPqB5FyPGo9NjTnS3LqDKn/m4GYnw=&content-type=application/json