Json To Apex
Last updated
Last updated
200 OK comes with Utility to create Apex wrapper class out of any given JSON. This utility can be used via a Quick Action button on the Integration channel record page.
Let us see how to configure this :
Click on the New button in 200 OK studio tab.
Create a channel with required data by passing the method, url, body etc.
After passing the data save and active the channel.
In the right top click on the dropdown, we can see option Json To Apex as shown in the below image.
On click of this button a screen flow will appear which has two fields
Class Name
Class body (JSON).
By default the class name is the same as Channel Name, but the user can give any name. Pass the JSON in the Class body field for which you want to create the wrapper class.
After passing the json click on the Submit button. Two classes with serializable and deserializable invocable methods will be generated along with the test classes.
Go to Setup and type Apex class in the quick find box. Click on the apex class and you can find the generated class along with the test classes
Apex class in setup
This is how we can confgiure and use Json To Apex.