Getting Started: Pushing Data
Overview
This guide covers the steps needed to send data from your ERP to Bushel’s platform.
All ERP data is sent to Bushel via our JSON REST API and is received by our Router service. From there, data is distributed throughout Bushel’s Platform and can be viewed in our Customer Portal, sent to Bushel Farm, and more.
Prerequisites
Before data can be sent to Bushel, you will need the following:
- Authorization Token
-
A static token provided by Bushel that uniquely identifies your integration. Contact your Bushel representative or [email protected] for a token.
Your First Payload
In this example, we will send two Locations to Bushel using the update-elevators
command.
Payload Body
Using data from your database or data store, start by mapping Location data to the update-elevators
payload, referencing the Sync API documentation. Your payload should look something like the following:
{
"data": [{
"update-elevators": {
"elevators": [{
"address_line_1": "507 7th St. N",
"address_line_2": "",
"cash_bids_hidden": false,
"city": "Fargo",
"deleted_at": null,
"email": "[email protected]",
"fax": "",
"id": "1",
"name": "Bushel World Headquarters",
"phone": "+17013690633",
"push_notifications_hidden": false,
"state": "ND",
"website": "https://bushelpowered.com",
"version": "1.0.0",
"zip_code": "58102"
},
{
"address_line_1": "4501 7th Ave N",
"cash_bids_hidden": false,
"city": "Fargo",
"id": "2",
"name": "Drop off site",
"push_notifications_hidden": false,
"state": "ND",
"website": "https://bushelpowered.com",
"version": "1.0.0",
"zip_code": "58102"
}]
}
}]
}
Note that any field which is not required may be provided as either null or simply not provided.
Sending the Request
URL
All ERP data, regardless of data type, is pushed to the /api/v1/push
endpoint of the Router in your target environment. The base URL the request is made to will depend on how your test environment was configured. Options for the full URL will be:
- Bushel Sandbox
- Bushel Production
Putting it all together
Putting it all together, our request payload will look something like the following, written as a CURL request:
curl --request POST \
--url https://router.translator.sandbox.bushelops.com/api/v1/push \
--header 'Accept: application/json' \
--header 'Authorization: PUT_YOUR_SECRET_AUTH_CODE_HERE' \
--header 'Content-Type: application/json' \
--header 'X-Request-ID: b9a759f5-21b3-4b91-85ae-caba0f880f4b' \
--data '{
"data": [{
"update-elevators": {
"elevators": [{
"address_line_1": "507 7th St. N",
"address_line_2": "",
"cash_bids_hidden": false,
"city": "Fargo",
"deleted_at": null,
"email": "[email protected]",
"fax": "",
"id": "1",
"name": "Bushel World Headquarters",
"phone": "+17013690633",
"push_notifications_hidden": false,
"state": "ND",
"website": "https://bushelpowered.com",
"version": "1.0.0",
"zip_code": "58102"
},
{
"address_line_1": "4501 7th Ave N",
"cash_bids_hidden": false,
"city": "Fargo",
"id": "2",
"name": "Drop off site",
"push_notifications_hidden": false,
"state": "ND",
"website": "https://bushelpowered.com",
"version": "1.0.0",
"zip_code": "58102"
}]
}
}]
}'
If successful, you will receive a HTTP 204: No Content
response, indicating that Bushel has successfully received and processed your payload.