Skip to content

I'm facing issue in converting format #3036

Answered by aslams2020
IncharaIse asked this question in Q&A
Discussion options

You must be logged in to vote

@IncharaIse
Go to your add a book request and in your body tab > raw > JSON > add this:

{
  "title": "To Kill a Mockingbird-New",
  "author": "Harper Lee",
  "genre": "fiction",
  "yearPublished": 1960
}

Like following -

Then in Authorization tab, choose Auth type API Key
then add

  • key = api-key
  • value = postmanrulz
  • Add to Header

Like following:

then lastly in your scripts tag add following scripts:

// save the "id" value from the response to a variable named "id"
const id = pm.response.json().id
// save the id as a collection variable named "id"
pm.collectionVariables.set("id", id)

This should resolve your errors.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@MastanSayyad
Comment options

Answer selected by MastanSayyad
Comment options

You must be logged in to vote
1 reply
@IncharaIse
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants