API problem creating new folder - Invalid Argument Items.Folder

  • 1
  • Problem
  • Updated 8 months ago
  • (Edited)
We are trying to make call for Create Folder api from our API proxy.

Below is our http raw request

POST /sf/v3/Items(fo0db77c-31fe-4a50-ace1-59c7cb1596e9)/Folder?overwrite=true&passthrough=false HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, br
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Accept-Language: en-US,en;q=0.9,fr;q=0.8
Authorization: Bearer xxxx
Transfer-Encoding: chunked
Content-Type: application/json
Host: spectrum-poc.sf-api.com
Connection: Keep-Alive
{"Name":"1TH345626726655", "Description":"Description", "ExpirationDate": "9999-12-31T23:59:59.9999999Z"}

We are getting below response.

{"code":"BadRequest","message":{"lang":"en-US","value":"Invalid Argument Items.Folder"},"reason":"BadRequest"}
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes

Posted 8 months ago

  • 1
Photo of shruthi

shruthi, Employee

  • 4 Posts
  • 0 Reply Likes
Hi Honey Goyal,

Can you confirm if the folder id you are passing in the request still exists. If the folder is deleted you might get the above response.

Thanks,
Shruthi
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Hi Shruthi,

Yes it exists. Can you please check at your end? Why this api is not working?

Thanks,
Honey Goyal
(Edited)
Photo of shruthi

shruthi, Employee

  • 4 Posts
  • 0 Reply Likes
Hi Honey Goyal,

The Api request is working fine from my end for different folder id in my account. Can you share the fiddler trace and also can you try with a different folder id and check if it returns the same error? Also can you remove Transfer-Encoding: chunked and try once. 

Thanks and Regards,
Shruthi
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Hi Shruthi,


Yes it is working fine from the postman. But we are trying from proxy. Can you please share any trace or Raw Request that you are getting from our side? I just want to know what is the issue with our proxy setup.

Thanks,
Honey Goyal
Photo of shruthi

shruthi, Employee

  • 4 Posts
  • 0 Reply Likes
Hi Honey Goyal,

Someone is looking at it. Will update you soon.

Thanks,
Shruthi
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Hi Shruthi,

Thank you very much for your help. We need to resolve this issue urgently.

Thanks,
Honey Goyal
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Honey Goyal,

Are you making the request via CURL from Windows? If so, could you check how the Json body is being passed to the curl command?

If you're using

-d '{"Name":"Name"}'
that will only work in Linux; Windows will require

-d "{\"Name\":\"Name\"}"
Let me know if that's not the issue or if that didn't help and we can keep inquiring. The cause of the error you see is a malformed JSON in the body, so we can go from there

Thanks,
Eli
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Hi Eli,


I just tried with slashes. I got the same error "Invalid Argument Items.Folder".  This is not the issue. As i have posted raw request above that we are trying from our proxy server. It seems fine to me.

Thanks,
Honey Goyal
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Thanks for confirming. We'll continue looking and get back to you as soon as possible. Could you share more details about your Proxy setup? I see both successful and failed requests from your account and I presume some are from Postman and others from the Proxy. The requests do not seem to differ in any ways, so any additional information you can provide would be helpful. I can reach out to you privately as well

Thanks,
Eli
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Now check with latest calls. I am hitting right now from our proxy.


Thanks,
Honey Goyal
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Honey,

I've sent you a private email requesting more info.

Best,
Eli
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Honey,

Looks like the issue is the use of the "Transfer-Encoding: Chunked" header value. Could you remove it and give it another go?

Thanks,
Eli
(Edited)
Photo of Honey Goyal

Honey Goyal

  • 7 Posts
  • 0 Reply Likes
Hi Eli,

Thank you for your help. Header was the only issue.

Thanks,
Honey Goyal