API 2.0 how to upload file with POSTMAN? - box-api

I'm reading API 2.0 documentation and try using POSTMAN (recommended in the documentation).
In "Upload a file" section, I got "404 not found" error.
for example:
{"type":"error","status":404,"code":"not_found","help_url":"","message":"Unknown Error","request_id":"11139828924fa91c0d283d2"}
POSTMAN window image is here.
Base URL is tring "upload.box.com/api/2.0" (temporary, according to the document).
What's wrong?

One more point, your POSTMAN request misses to indicate folder_id in its form data . You need that "folder_id" value for the request to work .

The domain specific Upload issues have all been resolved. You can now direct all API requests, including uploads, to https://api.box.com/2.0

Related

Logic Apps + Form Recognizer unable to send PDF to service

I have an Azure Logic App that uses a Analyze Document for Prebuilt or Custom models (v3.0 API) action. The Custom Model is good, I can hit it with Postman with no issue.
When I try to get a PDF from Sharepoint and send it to the service, I get an error saying:
{
"error": {
"code": "InvalidRequest",
"message": "Invalid request.",
"innererror": {
"code": "InvalidContent",
"message": "The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats."
}
}
}
I've tried:
Passing the Get file content directly to the Document/Image File Content input
Passing body('Get_file_content)['$content']
Passing concat('data:application/pdf;base64,',body('Get_file_content')['$content']
This one converts to PDF in a Base64-to-PDF tool so I know the Base64 is good
Then I found out that the service wants binary format:
Passing base64ToBinary(body('Get_file_content')['$content'])
Still no go
Why can I not send the file to the Form Recognizer service?
EDIT:
Thank you to #vijaya. They helped me see that the Document/Image URL parameter was not necessary. Leaving that blank and using the original Get File Content worked!
Issue is with content-type. You need to pass content-type along with content for analyze document. I have reproduced issue from my side and below are steps I followed,
Initially created logic app as shown below,
Logic app failed with error,
The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats.
Next modified logic app as shown below,
In Compose action setting content as
outputs('Get_blob_content_(V2)')?['body']?['$content'] and passing content-type as application/pdf as we are dealing with pdf files.
In Analyze Document for Prebuilt or Custom models (v3.0 API) action, using outputs of compose in Document/Image File Content.
Logic app ran successfully as shown below,
Output of Analyze Document is as shown below,

BIM360Docs API Export Document with markup not working?

As shown in the image, I have tried API provided by BIM360 from the following link:
https://forge.autodesk.com/en/docs/bim360/v1/tutorials/document-management/export-pdf-from-docs/
But I am not able to run API 'Export files with markups' and received an error as shown in the image.
I have also mentioned project id and version id which is used in API call.
How can I solve this issue?
please encode your version id to URL-safe string with Uri.EscapeUriString(String). There are some invalid string for a URL in the version id.

Issue while upload/send file with post request using Jmeter

I have one post request where I am uploading image as per below using postman :
I am trying to perform same request using Jmeter. I did following setting in Jmeter :
But somehow it is not working. I tried with multipart/form-data for POST option also but no luck.
our API developer has set validation that if api get any other file then image then they send response : invalid file type. I am getting this response all time when do POST request with image from Jmeter. It works fine with postman.
In Debugger post processor it shows like this : HTTPsampler.Files=path:'C:\apache-jmeter-4.0\bin\samplex.png'|param:'fileName'|mimetype:'image/png'
Finally I was able to resolve issue by removing Parameter name and MIME Type from tab File Upload. I did provide only file path and it works. Also I unchecked Use multipart/form-data for POST
You see button Browse.. in picture 2 you post. Do for same with Postman, choose file and send the request.
Make sure you have a valid file at the specified path.
Check your postman whether it is sending any other things in the header like Content-Type.
Check out File Uploads using JMeter guide for more information on simulating file uploads with JMeter
As I wrote in comment, If you want to send binary file as is (not as parameter value), remove the Parameter Name column value (file)
See JMeter's HTTP Request reference for more details:
File Path: Name of the file to send. If left blank, JMeter does not send a file, if filled in, JMeter automatically sends the request as a multipart form request.
If it is a POST or PUT or PATCH request and there is a single file whose 'Parameter name' attribute (below) is omitted, then the file is sent as the entire body of the request, i.e. no wrappers are added. This allows arbitrary bodies to be sent. This functionality is present for POST requests, and also for PUT requests.

iTunes Store Customer Reviews API XML Endpoint Broken

I used to use the XML endpoint because it provided review dates for each review called 'updated'. This is not contained in the JSON endpoint. However, the XML endpoint stopped working. I get the error seen below:
Web Server Error
Description: The host did not return the document correctly.
Has anyone experienced the same issue? Any workarounds? Do you anticipate this will ever be fixed by Apple? Do you think the JSON endpoint might be taken down any time soon?
XML Endpoint (Broken)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/xml
JSON Endpoint (Working)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/json
It appears the XML endpoint is up and running again. No more Web Server Error. Hopefully the endpoint stays up.

400 Problems parsing JSON - GitHub API and POSTMAN using OAuth

I want to create a file in my private Repo via the GitHub API.
https://developer.github.com/v3/repos/contents/#create-a-file
PUT /repos/:owner/:repo/contents/:path
I'm using Postman for testing and also already authorized via OAuth.
https://api.github.com/repos/user/reponame/contents/test.txt?message=Myfirstmessage&content=SGVsbG8gV29ybGQgaW4gQmFzZTY0IQ==
The error message is: "Problems parsing JSON"
But where exactly is the problem?
I think you have to use choose file from body / binary. I've just had the same problem with creating an issue on github. Putting attributes in body / raw / json solved the problem.