Skip to main content

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

 

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?


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>’


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


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


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

 


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


@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