Skip to content

Send a Package

POST/api/packageAuth required

Push data from your system to personnel and assets in the field.

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token> or Basic <username>:<password>
x-api-key<api-key>

Body — exactly one of message, location, waypoint, or data:

Message

A text message, delivered to one person in a Workspace.

curl https://api.somewear.co/api/package \
-H "Content-Type: application/json" \
-H "x-api-key: <YOUR_API_KEY>" \
-d '{
"sourceUserId": "1",
"workspaceId": "1",
"targetUserId": "1",
"message": {
"content": "Hello space!",
"phone": "+15555555555",
"email": "somewear@example.com",
"timestamp": "2023-07-17T22:45:06Z"
}
}'

Location

A position report.

curl https://api.somewear.co/api/package \
-H "Content-Type: application/json" \
-H "x-api-key: <YOUR_API_KEY>" \
-d '{
"sourceUserId": "1",
"workspaceId": "1",
"location": {
"latitude": "37.781001",
"longitude": "-122.393456",
"timestamp": "2023-07-17T22:45:06Z"
}
}'

Waypoint

A point of interest.

curl https://api.somewear.co/api/package \
-H "Content-Type: application/json" \
-H "x-api-key: <YOUR_API_KEY>" \
-d '{
"sourceUserId": "1",
"workspaceId": "1",
"waypoint": {
"latitude": "37.819466",
"longitude": "-122.478628",
"timestamp": "2023-07-17T22:45:06Z",
"name": "Golden Gate Bridge"
}
}'

Data

Raw bytes, base64-encoded — for formats outside Somewear’s own.

curl https://api.somewear.co/api/package \
-H "Content-Type: application/json" \
-H "x-api-key: <YOUR_API_KEY>" \
-d '{
"sourceUserId": "1",
"workspaceId": "1",
"data": {
"payload": "SGVsbG8gc3BhY2UgZnJvbSBhIG5vbi1Tb21ld2VhciBkYXRhIGZvcm1hdA=="
}
}'

Response

Success, empty body.