Skip to main content
Solved

Issue in calling FDM Post APIs


Forum|alt.badge.img

I am trying new FDM APIs. In POST endpoints I am facing issue “Missing body for POST request”

Am I missing some parameters? I am using POST body as per documentation

 

Best answer by Snehal Jagtap

@Juan Alvarado yeah it was postman setting issue, not sure in headers postman is giving as data-raw and by changing it to data it worked. Thanks!

View original
Did this topic help you find an answer to your question?

7 replies

Forum|alt.badge.img

Hi @Snehal Jagtap, and thanks for reaching out.

 

It would be very helpful if you included the request payload you’re trying to use, resulting in the problem you’re experiencing?


Forum|alt.badge.img
  • Author
  • Committed
  • 3 replies
  • February 21, 2023

This is the payload I am trying to use in POST Space API

https://westeurope-1.cognitedata.com/api/v1/projects/slb-pdf/models/spaces

{

"items": [

{

"space": "snehal-test-space",

"description": "snehal-test-space",

"name": "snehal-test-space"

}

]

}

 

Headers : 

--header 'content-type: application/json' \

--header 'cdf-version: alpha' \

--header 'Authorization: Bearer <token>’


Forum|alt.badge.img+4

Hi @Snehal Jagtap 

I'm quite new around here so I could be 3 steps behind you.  But is that the correct url for applying spaces?  Should "models" be replaced with "datamodelstorage" as below?

api/v1/projects/{project}/datamodelstorage/spaces 

 

Docs


Forum|alt.badge.img
  • Author
  • Committed
  • 3 replies
  • February 21, 2023

I tried with this as well, still I am getting same issue. Am I missing something in request?


Forum|alt.badge.img+4

It looks like the external id field is required in the request.

 


Juan Alvarado
Seasoned
Forum|alt.badge.img

@Snehal Jagtap the error “missing POST body” suggests the request is malformed. Have you tried different tools (Postman, curl, VSCode REST client, etc.)?


Forum|alt.badge.img
  • Author
  • Committed
  • 3 replies
  • Answer
  • February 21, 2023

@Juan Alvarado yeah it was postman setting issue, not sure in headers postman is giving as data-raw and by changing it to data it worked. Thanks!


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings