Lo sentimos. Esta página no ha aún traducida. No se preocupe, el equipo localización de Emarsys está trabajando duro para proporcionarle toda la documentación en su idioma!
Updates those records in a custom table in the Relational Data Service which match the specified conditions.
Note: These tables are only available if you subscribed to this service. For further information, please contact your Account Manager.
Endpoint
PATCH /api/rds/tables/<table_name>/records
Parameters
Name | Type | Description | Comments |
---|---|---|---|
search | JSON object with columnname-value pairs | The values define the criteria to search records for updating. | |
update | JSON object with columnname-value pairs | Defines the new values of the matching records. |
Request Example
[ { "search": { "name": "Joe", "age": 34 }, "update": { "age": 35, "color": "red" } }, { "search": { "name": "Jack", "age": 10 }, "update": { "age": 11, "color": "blue" } } ]
This request updates the age to 35 and the color to red in the records where the name is Joe and age is 34, and it also updates the age to 11 and the color to blue in the records where the name is Jack and the age is 10.
Result Example
Normal Result
{ "replyCode": 0, "replyText": "Rows updated: 2" }
Error Condition
{ "replyCode": 15001, "replyText": "Fields are not the same in every record." }
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 15001 | Fields are not from the same column in every record. | The provided fields must belong to the same column in every record. |
400 | 15002 | Maximum number of records is 1000. | You’ve reached the maximum number of records allowed in a request. |
400 | 15003 | [column_name] field is missing. | Some fields specified in the request are not in the table. |
404 | 15004 | Table does not exist. | The table you are trying to insert to does not exist. |
400 | 15005 | JSON format is invalid. | The JSON in the request is not valid. |
500 | 15006 | Internal error occurred. | An internal server error occurred. Please try again later. |
400 | 15007 | Criteria fields are not indexed. | The fields used in the criteria must be indexed in the table. |