Add a single document
Contributors
POST /persistence/v1/service/{serviceName}/collection/{collectionName}/account/{accountId}
Adds a single document to the specified collection for the specified service database and account. Returns the newly added document.
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
serviceName |
string |
path |
True |
Participating external service name (name of the database). |
collectionName |
string |
path |
True |
Persistence service collection name (name of the table). |
accountId |
string |
path |
True |
Persistence Service Cloud Manager account identifier for Tenancy service specification. |
X-Service-Request-Id |
string |
header |
False |
Request identifier used to tag the request for better supportability. |
Request Body
Response
Status: 200, Newly added persistence service document.
Name | Type | Required | Description |
---|---|---|---|
_id |
string |
False |
Persistence Service response document identifier. Auto generated and immutable. |
document |
False |
(Opaque) Persistence service document as a key-value pair passed as a request. |
Example response
{
"_id": "60f51cf96bf74c1eec9be2cc"
}
Response
Status: 4xx, Error response
Name | Type | Required | Description |
---|---|---|---|
errorCode |
string |
False |
Error code |
error |
string |
False |
Error category |
message |
string |
False |
Error description message |
Example response
{
"errorCode": "P1002",
"error": "api error",
"message": "No document found of the specified documentId"
}
Response
Status: 5xx, Error response
Name | Type | Required | Description |
---|---|---|---|
errorCode |
string |
False |
Error code |
error |
string |
False |
Error category |
message |
string |
False |
Error description message |
Example response
{
"errorCode": "P1002",
"error": "api error",
"message": "No document found of the specified documentId"
}
Definitions
PersistenceServiceRequest
(Opaque) Persistence service document as a key-value pair passed as a request.