Getting started
Upload a source archive
Send archive bytes through the API with filename in the query string. The response includes the source upload ID.
PUT
/api/customer/v1/source/uploads/contentThis operation can remove, overwrite or interrupt resources, or grant access. Check the project and resource IDs before sending it.
Query parameters
| Name | Type | Required | Limits |
|---|---|---|---|
filename | string | Yes | At least 1 character(s) |
projectId | string | No | At least 1 character(s) |
Request body
Send the file bytes with Content-Type: application/octet-stream. Set the required filename query parameter.
Example request
Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.
curl --request PUT "$HCODE_BASE_URL/api/customer/v1/source/uploads/content?filename=source.zip" \ --header "Authorization: Bearer $HCODE_API_KEY" \ --header "Content-Type: application/octet-stream" \ --data-binary @./source.zip
Response
The JSON shape is defined in the response schema.
Response schema
{
"type": "object",
"properties": {
"uploadId": {
"type": "string"
},
"expiresAt": {
"type": "string"
},
"sizeBytes": {
"type": "integer"
},
"filename": {
"type": "string"
},
"directUpload": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"method": {
"type": "string"
},
"headers": {
"type": "object",
"additionalProperties": true
}
},
"required": [
"url",
"method",
"headers"
],
"additionalProperties": true
},
"operationId": {
"type": "string"
},
"operations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"href": {
"type": "string"
}
},
"required": [
"id",
"status",
"href"
]
}
}
},
"required": [
"uploadId"
],
"additionalProperties": true
}See errors and retries for failure responses.