Device API / Operation directory
Uploads and files
Stage a file, then transfer it to an active device or install an APK.
Stage a local file
Terminal
curl "$APPCLOUD_BASE/api/v1/files" -H "Authorization: Bearer $APPCLOUD_API_KEY" -H "Content-Type: application/octet-stream" -H "X-File-Name: sample.txt" --data-binary @sample.txtCopy file.id from the 201 response. Files expire after one hour. Each file can be up to 8 MiB with up to 32 MiB staged on your account. List staged files with GET /api/v1/files and remove one with DELETE /api/v1/files/{fileId}.
Transfer to a device
JSON
{
"action": "uploadFile",
"value": "FILE_ID"
}Send this body to Control a device. For an APK, use installApp and include its Android packageName. Delivery requires Appcloud to be reachable over HTTPS. Keep the staged file until the transfer finishes.
5 of 5 operations
Uploads and files
Stage a filePOST /api/v1/files
Terminal
curl -X POST "$APPCLOUD_BASE/api/v1/files" \
-H "Authorization: Bearer $APPCLOUD_API_KEY" \
-H "Content-Type: application/octet-stream" \
-H "X-File-Name: sample.txt" \
--data-binary @sample.txtList staged filesGET /api/v1/files
Terminal
curl -X GET "$APPCLOUD_BASE/api/v1/files" \
-H "Authorization: Bearer $APPCLOUD_API_KEY"Delete a staged fileDELETE /api/v1/files/{fileId}
Terminal
curl -X DELETE "$APPCLOUD_BASE/api/v1/files/$FILE_ID" \
-H "Authorization: Bearer $APPCLOUD_API_KEY"Copy a staged file to the phonePOST /api/v1/devices/{id}/actions
Replace FILE_ID with the ID returned when you staged the file.
Terminal
curl -X POST "$APPCLOUD_BASE/api/v1/devices/$DEVICE_ID/actions" \
-H "Authorization: Bearer $APPCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"uploadFile","value":"FILE_ID"}'Install a staged APKPOST /api/v1/devices/{id}/actions
Replace FILE_ID with the ID returned when you staged the file.
Terminal
curl -X POST "$APPCLOUD_BASE/api/v1/devices/$DEVICE_ID/actions" \
-H "Authorization: Bearer $APPCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"installApp","value":"FILE_ID","packageName":"com.example.app"}'