Solved

Trying to create entry using API call

  • 19 August 2022
  • 3 replies
  • 81 views

Userlevel 3
Badge

Hi there,

 

I am following your API docs here: https://www.contentstack.com/docs/developers/apis/content-management-api/#create-an-entry

 

I have my postman request set up as follows, using verbatim the example body, and am receiving a response of:

 

{
"error_message": "Please send your attributes wrapped in 'entry'.",
"error_code": 141
}

 

Request:

 

I have my headers set properly, using a management token, and my Stack API key, and the content-type. 

 

Please advise,

icon

Best answer by Sachin 20 August 2022, 11:46

View original

3 replies

Userlevel 2

 

Hi @Tyler , I was able to create the entry successfully using StackAPI key, management token and setting Content-Type to application/json, however we received the similar error while we set the Content-Type to application/javascript.

Could you please check and confirm that Content-Type is set correctly in Header?

Below is the screenshot for your reference.

Screenshot with Content-Type (application/json) in Headers 

 

Screenshot with incorrect Content-Type(application/javascript or something different) in Header

 

Hi @Tyler,

It seems to be an Content-Type header issue from your screenshots, In body section also we can see you have text instead of JSON

 

Userlevel 3
Badge

Hey @Harshal Patel that seemed to do the trick!

 

Is there any way to make suggestions to your documentation on the API? I have a few more examples that might be useful and rest call examples that are a bit more specific.

 

Thanks

Reply