0

How to send array as parameter in API Call?

I just want to know how can I pass and array as parameter in Java,

Like:-

 "list":[
              {
                 "name":{{$randomFullName}}, 
                 "account":{{$randomAlphaNumeric}},
                 "accountbalance":{{$$randomInt}}
                  
              }

    "Message":  "Dear {{name}}, your {{$accountnumber}} has been credited with Rs.{{($accountbalance)}}.

}

I just want to pass name, account, account-balance in the message body.



2 Answers 2

2

Your question seems to be a bit unclear.

If you just want to set the values during runtime, before sending the request, you need to set the environment and add these as the variables in the postman.

Or if you're trying to build the whole list dynamically, then you can write the complete code for that in the request script and simply use that while sending the request. This can help you with the same.

Sign up to request clarification or add additional context in comments.

Comments

0

it doesn't work that way . You can't use a parameter as an object in a request body . Instead , you should extract the list in your code and then send message accordingly in code only .

2 Comments

I am trying to use this code in Postman, I have already build a entity class with name, account, account balance, so just try to pass the value
Your question is unclear ,But what I assume from your question is that you want to use parameters 'name' , 'account', 'accountBalance' as objects and use them in another parameter as we do it in any Coding language which is not possible in Postman .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.