Rest Api response with FileName instead of FileId
Hi Team,
I would like to know that instead of using the file id in the api get request can I use the filename as (xxxx.xls)
Thanks
Kandasamy
Answers
-
You can specify the import data source or export name in the URL path instead of the numeric ID, although you may need to be careful with certain characters that must be encoded (the tool you use to access the API may handle this).
0 -
Hi
To check the response I am using the Postman and in the postman I am using the Get method. In the endpoint I have given https://api.anaplan.com/1/3/workspaces/8a81b0945cdbe1ec015ce678axxxxxxx/models/F54A3C7D6CE54A0F82EE730xxxxxx/Current Page - Headcount Data Master - Report.xls
Under the Header I have given the Authorization. I would like to know what type of content type I need to select.
Thanks
Kandasamy0 -
Use application/octet-stream for the Accept header.
If the file is large then use the /2/0 API or the chunks endpoints instead.
0 -
Hi
I tried in the Post man as you suggested , but I am getting not found error.
Please let me know if I missed anything
Thanks
Kandasamy0 -
It looks like you're missing the path component "/files", which should follow the model ID. Test using a numeric identifier first, then substitute the name for the numeric identifier.
0 -
Hi
As you suggested in the postman I have given the end url as
https://api.anaplan.com/1/4/workspaces/8a81b0945cdbe1ec015ce678a3f60xxxx/models/420BD91A051443C6ADACCF6xxxxxxxxxxx/files/116000000005
But I am getting the response as
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Anaplan</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width = 960">
<link rel="shortcut icon" href="lib/anaplan/themes/original/images/favicon.ico">
<style type="text/css">
@import "lib/dojo/resources/dojo.css";
html {
overflow: auto;
}
</style>
</head>
<body>
<div id="pageWrap" class="pageWrap">
<div class="banner">
<h1>An error has occurred whilst processing your request:</h1>
</div>
<div>
<pre class="original">Not Found</pre>
</div>
<div>Please close your browser window and try again.</div>
<div>If the problem persists then please contact Anaplan Support.</div>
</div>
</body>
</html>
0 -
Hi
I am getting the response for the .csv files but for the .xls file I am getting the Not found error as mentioned in my previous post
Thanks0 -
Now you've got /1/4 as a version instead of /1/3 or /2/0. That's not a valid API version, hence the not found error.
0 -
Hi
I tried with 2/0 version to get the files https://api.anaplan.com/2/0/workspaces/8a81b0945cdbe1ec015ce678a3f60051/models/420BD91A051443C6ADACCF69D33EBEA0/files
but I am getting response as
{
"status": {
"code": 401,
"message": "Not Authorized."
}
}
When I tried version1/4 I am getting File not found.
Api version 1/3 is only giving response to me.
Thanks
0 -
1/4 is not a valid API version.
2/0 will require a different Authorization: header to 1/3 (see https://anaplanauthentication.docs.apiary.io/)
0