Skip to main content

Save External API Response in User Defined JSON Key

In this video you will understand as how to store the External API (REST API) Response JSON data in user defined/custom JSON key. Use cases could be that a JSON response comes from an API and same type of data comes in another API and you want to save both the responses in the browser session in the custom key of their own. In such cases you won't end up overwriting each others data.

1. Create an Event to Save External API response

Create an event to save external API response in user defined JSON key and it will indicate what exactly has to be done. Choose the Add Event option from the Events option in the left menu. Name the event and click the Create button. The first event is to send data to an external API.

DrapCode Builder Export Import Collection Item

2. Fill the Form

In the form that appears choose the external API you have created. You can choose the optional save API response as you prefer; in browser session and custom JSON key. Mention the original key and the overriding key. Then Save your settings.

DrapCode Builder Export Import Collection Item

3. Create an External API

To get data you need to create an External API. External APIs are modules that are used to create a Rest API such as GET API, POST API, DELETE, etc. Although you may also use an existing Create API too. APIs can be accessed from Settings → External API or from the top right hand-side. Then select the Create External API button. You can create the external API before creating the event too. Give a name to your external API. You need to choose the GET to create a call.

DrapCode Builder Export Import Collection Item

4. Preview the Response

Now you can Preview the changes by reloading the page. Single click the External API Response button.

DrapCode Builder Export Import Collection Item

5. Create an Event

In the event you created make an external API to store data in browser session, in custom JSON key and Save your settings.

DrapCode Builder Export Import Collection Item

6. View the Reponse

Now you can Preview the changes by reloading the page. Single click the External API Response button. The data in browser session too can be accessed from here.

DrapCode Builder Export Import Collection Item

7. Modify the Event

Now you can again go back to the event and Override the JSON key and mention teh fields.

DrapCode Builder Export Import Collection Item

8. Preview the External API Response

Now you can Preview the changes by reloading the page. Single click the External API Response button. The updated external API response will be visibile here.

DrapCode Builder Export Import Collection Item