Forum Discussion

kalani96746's avatar
11 years ago

How do you use a template parameter in a REST request body?

I'm sending some JSON as a post to a REST service with a REST Project(not Test Suite). I'm not creating Tests; just a developer structuring my POSTS to try sample requests.
I've set up a REST project and am POSTing some JSON. I've managed to get Project Variables in the request body working but what I want to do is use the parameters section when you double-click the actual REST request. The parameters are can be used in the url itself such as
/payment/v1/{address}/transactions/

if address were defined a template parameter it would replace that part of the url with the value.

I cant seem to use them in the actual body of the POST message. How do I do this (or can I)? I don't really want to define it as a Project other variable as I change them as I develop and would like to do so on the same screen I trigger the request on. What is the syntax I can use to do this?

Thank you,

Kalani

PS - sample JSON below



{"notification": {
"notificationEventType": "grantEN",
"endUserId": "tel:+<templateParameterVariableHere>",
"operatorID": "4834",
"activityTimestamp": "2014-06-26T17:42:58Z",
"providerID": "1001",
"serverReferenceCode": "26045",
"clientCorrelator": "54321",
"serviceId": "6614",
"productId": "otc_someotcproduct",
"productName": "SpaceInvaders",
"amount": "20",
"currency": "USD",
"purchaseCategoryCode": "Game"
}}