JSON OR. CSV file
POST {{baseUrl}}/data/binary-files
2. Adding events to the diamond blockchain by uploading files
The data ingestion API also allows for events to be specified in Json or CSV files. The same dedicated schemas are also used to detail the specifics of the events.
The /data/binary-files endpoint is used to upload of files of type .csv and .json. The file name provided must be unique for every request.
POST http://api.everledger.io/data/binary-files
Header Information
Sending information in file format means that the content type specified in the header of your API request should indicate the request is a multipart/form-data request. The authentication is generic for the API and should also be placed in the headers.
x-evl-client-id :
evl-public-api-key :
origin :
Content-Type: multipart/form-data
Body form data
The body form data is being used to specify the file name and path as and schema information as form data in the body of the API request.
schemaId :
file : < file-absolute-path>
The schema field needs the name of the schema which is being used to provide the event details.
Request Body
[{"name"=>"schemaId", "value"=>"Invoice", "datatype"=>"string"}, {"name"=>"file", "value"=>nil, "datatype"=>"null"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-evl-client-id | string | ||
evl-public-api-key | string | ||
Content-Type | string | ||
origin | string |