Upload or replace a hosted asset at a specific resource path.
Path parameters
-
An Atlas Project/Group ID.
-
The ObjectID of your application. The App Services API Project and Application IDs section demonstrates how to find this value.
Body
Required
The hosted asset file and its metadata. (Must use
Content-Type: multipart/mixed)
-
An asset metadata document (encoded as JSON).
-
The asset file to upload (encoded as binary).
PUT
/groups/{groupId}/apps/{appId}/hosting/assets/asset
curl \
--request PUT 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/hosting/assets/asset?path=string' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"meta": {
"path": "string",
"size": 42,
"attrs": [
{
"name": "string",
"value": "string"
}
],
"hash": "string"
},
"file": "@file"
}'
Request examples
{
"meta": {
"path": "string",
"size": 42,
"attrs": [
{
"name": "string",
"value": "string"
}
],
"hash": "string"
},
"file": "@file"
}
Response examples (400)
{
"error": "string",
"error_code": "string"
}