function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pradhap Rao 7Pradhap Rao 7 

400 bad request when posting

Hello All, 

Trying to get hang on Vision API . I am following this link :

I have generated my oauth token through here :

I am trying to create dataset, all I get is 400 bad request. I am using postman and trying this with a einstein enabled developer edition. 

What am i doing wrong here?

User-added image

Michael Machado 22Michael Machado 22
Are you uploading data to an existing dataset?  I don't see a link to the data in your body if so. 
I too got the same issue, Any solution ??
Sachin RamachandranSachin Ramachandran
Hi Karthik,
Could you please share the paramters you have used for uploading the dataset.

400 "Bad Request" happens when a required field is missing or when invalid input is passed. In the above case the API expects either "data" or "path" parameter pointing to dataset file either uploaded from local or a file hosted.

Uploading a image dataset should be either of the below two forms
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "data=@C:\Data\" -F "type=image"
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "path=" -F "type=image"
Detailed explanation on the use of the APIs can be found here:

Please keep us posted if you have more questions

Andy Tillo 2Andy Tillo 2
If you're still wondering (I had the same issue), take out the "Content-Type" from your Header section field, and just call it from the Body section: grab the form-data from the Body tab...
Hey @Sachin Ramchandra 
I'm Facing error bit same, here when i'm creating Lead i'm getting error from external
Below is my error i'm getting
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, failed to send the lead, error response: {"IsMutuallyAuthenticated":false,"Cookies":[],"Headers":["Connection","Date","Set-Cookie","Strict-Transport-Security","X-Robots-Tag","Cache-Control","Sforce-Limit-Info","Content-Type"],"SupportsHeaders":true,"ContentLength":-1,"ContentEncoding":"","ContentType":"application/json;charset=UTF-8","CharacterSet":"UTF-8","Server":"","LastModified":"\/Date(16599-0400)\/","StatusCode":"BadRequest","StatusDescription":"Bad Request","ProtocolVersion":{"Major":1,"Minor":1,"Build":-1,"Revision":-1,"MajorRevision":-1,"MinorRevision":-1},"ResponseUri":"","Method":"POST","IsFromCache":false}