cancel
Showing results for 
Search instead for 
Did you mean: 

How to send dynamic Json request to API using groovy script

SOLVED
New Contributor

How to send dynamic Json request to API using groovy script

 

can some one provide me sample snippet for to read dynamic json request to API using groovy script. 

 

Also let me know is there any other way to automate dynamic Json requests apart from groovy script . below is my sample request.

 

{
"id": 65,
"name": "Test",
"displayName": "Test",
"description": "Test",
"status": "Active",
"updatedby": "Test",
"updatedon": "2020-08-13T00:00:00",
"rolePermission": {
"rolePermissionInfo": [
{
"name": "Test",
"permission": "Full Access",
"centername": "Test",
"displayname": "Test"
},
{
"name": "Test1",
"permission": "Full Access",
"centername": "Test1",
"displayname": "Test1"
},
{
"name": "Test1",
"permission": "Full Access",
"centername": "Test1",
"displayname": "Test1"
}

]
},
"mode": Test
}

 

Note : Role permission info has array of value and it will change dynamically.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: How to send dynamic Json request to API using groovy script

@mmanideep :

 

You can refer below link to generate request dynamically.

 

https://community.smartbear.com/t5/SoapUI-Pro/TechCorner-Challenge-4-How-to-Generate-a-Request-Body-...


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

1 REPLY 1
Highlighted
Community Leader

Re: How to send dynamic Json request to API using groovy script

@mmanideep :

 

You can refer below link to generate request dynamically.

 

https://community.smartbear.com/t5/SoapUI-Pro/TechCorner-Challenge-4-How-to-Generate-a-Request-Body-...


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors