RealNetworks
11 years agoOccasional Contributor
How to assign a value to a variable in the Request JSON body
I have come to a situation where I need to assign a unique value to an email 'field' REST Request JSON body. I am supposing I will need to write a script to do so but how?
Here's how my json body looks like:
{
"first_name": "testLoadFirstName",
"last_name": "testLoadLastName",
"username": "testloaduser6@merc.com",
"email": "testloaduser6@merc.com",
"password": "WnBaUEFlVk82VktnU2k2QG1lcmN1cnliZXRhLmNvbQ==",
"tos_agree": "true",
"device_id": "loadDeviceId1",
"device_user_agent": "loadTestUserAgent1",
"device_name": "loadTestDeviceName"
}
The value for the email can be something like this:
java.util.UUID.randomUUID() + '@merc.com'
Any help will be highly appreciated. Please let me know if you need any further info. Thanks in advance!
Here's how my json body looks like:
{
"first_name": "testLoadFirstName",
"last_name": "testLoadLastName",
"username": "testloaduser6@merc.com",
"email": "testloaduser6@merc.com",
"password": "WnBaUEFlVk82VktnU2k2QG1lcmN1cnliZXRhLmNvbQ==",
"tos_agree": "true",
"device_id": "loadDeviceId1",
"device_user_agent": "loadTestUserAgent1",
"device_name": "loadTestDeviceName"
}
The value for the email can be something like this:
java.util.UUID.randomUUID() + '@merc.com'
Any help will be highly appreciated. Please let me know if you need any further info. Thanks in advance!