JSON Parser
Before you begin
In order to use the features in this section you need to have an active Spojit account. If you don't have an account you can checkout out the pricing and register here. If you already have an account you can login here.
This service can write a JSON file from source data which could be used that to create a file on a FTP or make a request in the JSON format. It can also read the data from a JSON file which would create data output.
Tip
Choose the writeToString
or readFromString
methods to input/output as a string instead of a file.
Writing a JSON file¶
When the write configuration is selected the service will write a JSON file from mapped data and configuration options.
Option | Description | Default | Required |
---|---|---|---|
Method | Select "write" to write a JSON file. | - | TRUE |
Important
The parser does not generate the file itself rather the raw data that can be used by other services to generate or send a file (i.e SFTP/HTTP Request).
Example configuration and mapping
The following example shows you how to configure the JSON Parser to create a JSON file from a data object.
The schema can be whatever you want and for this example we are going to create an OBJECT schema with the specified fields:
Given the following source data from another service:
We can map the applicable fields with the schema object:
Reading a JSON file¶
When the read configuration is selected the service will read the raw data from a JSON file to create output data. The output data can then be used by other services.
Option | Description | Default | Required |
---|---|---|---|
Method | Select "read" to read a JSON file | - | TRUE |
Raw Data | The raw data of the JSON file that will be parsed | - | TRUE |
Info
There is no need to configure the service data that is read. The JSON data will automatically create the data object.
Example configuration and mapping
The following example shows you how to configure the JSON Parser to create a data object.
Given the following source data from another service:
The location of the raw JSON data needs to be specified in the configuration:
The JSON reader doesn't require any service data setup.