/connections endpoint¶
The /connections endpoint provides management functions for creating, listing, updating, enabling, and disabling DropStream connections.
List¶
To get a list of existing connections, make a GET request to /connections.
| Endpoint | /connections |
|---|---|
| Method | GET |
| Auth | JWT |
| Success status | HTTP 200 |
| Response (JSON) | array of connections |
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections
Response:
[
{
"id": 2706,
"customer_id": 3775,
"warehouse_id": 4609,
"store_id": 5603,
"name": "My Connection",
"connection_type": "fulfillment",
"created_at": "2020-08-19T14:57:20.000Z",
"enabled_at": null,
"locations": []
},
...
{
"id": 2716,
...
}
]
HTTP/1.1 200 OK
Create¶
To create a new connection, make a POST request to /connections with the new connection properties.
| Endpoint | /connections |
|---|---|
| Method | POST |
| Auth | JWT |
| Payload | Properties of the new connection object |
| Required properties |
|
| Additional Requirements | The combination of customer_id, store_id, and warehouse_id must be unique to the new connection |
| Success status | HTTP 201 |
| Response (JSON) | id of the new connection |
Example
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections \
-d @- <<EOF
{
"name": "My New Connection",
"customer": {
"company_name": "foo"
},
"store": {
"adapter": {
"auth_token": "abc123xyz890",
"secret_key": "mysecret"
},
"description": "My Sellbrite Store",
"name": "My Store",
"platform": "sellbrite"
},
"warehouse": {
"adapter": {
"connection_string": "sftp://wh1:secret@ftp.getdropstream.com"
},
"description": "My New Warehouse",
"platform": "dropstream"
}
}
EOF
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections \
-d @- <<EOF
name=My New Connection&
customer[company_name]=foo&
store[adapter][auth_token]=abc123xyz890&
store[adapter][secret_key]=mysecret&
store[description]=My Sellbrite Store&
store[name]=My Store&
store[platform]=sellbrite&
warehouse[adapter][connection_string]=sftp://wh1:secret@ftp.getdropstream.com&
warehouse[description]=My New Warehouse&
warehouse[platform]=dropstream
EOF
Response:
{ "id" : 5678 }
HTTP/1.1 201 Created
Update¶
To update an existing connection, make a PATCH request to /connections/{id} with the updated connection properties.
| Endpoint | /connections/{connection_id} |
|---|---|
| Method | PATCH |
| Auth | JWT |
| Payload | the updated connection properties |
| Success status | HTTP 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections/1234 \
-d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections/1234 \
-d @- <<EOF
enabled_at=2019-01-01
EOF
Response:
HTTP/1.1 204 No Content
Enable¶
To enable a connection, make a PATCH request to /connections/{id} with an updated "enabled_at" value.
| Endpoint | /connections/{connection_id} |
|---|---|
| Method | PATCH |
| Auth | JWT |
| Payload (JSON) | { "enabled_at" : {dateString} } |
| Success status | HTTP 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections/1234 \
-d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF
Response:
HTTP/1.1 204 No Content
Disable¶
To disable a connection, set its "enabled_at" value to null.
| Endpoint | /connections/{connection_id} |
|---|---|
| Method | PATCH |
| Auth | JWT |
| Payload (JSON) | { "enabled_at" : null } |
| Success status | HTTP 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections/1234 \
-d @- <<EOF
{ "enabled_at" : "2019-01-01" }
EOF
Response:
HTTP/1.1 204 No Content