openapi: 3.2.0 info: title: Emarsys Core API - Relational Data endpoint batch Rds API description: In this batch you may find endpoints related to Relational Data. version: v2 servers: - url: https://api.emarsys.net/api tags: - name: Rds paths: /rds/connections/{connectionName}/tables/{tableName}/records: get: summary: Query Records in an RDS Table description: "Returns the records from a custom table in the Relational Data Service (RDS).\n\nThis feature is only available for subscribed customers. For further information, contact your account manager.\n\n\n> #### Watch Out!\n>\n> Only for Emarsys hosted databases.\n>\n\n\n> #### Warning!\n> Please note that in order for the example query on the right to work, the required parameter `keyField` and its value has to be appended at the end. \n> For example: \n> \n> `~/rds/connections/connectionName/tables/tableName/records?name=Joe`\n\n\n\n**Note:** Results are not paged. The maximum number of objects per request is 1000." operationId: queryRecordsInRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string - name: '{keyField}' in: query description: 'The name of the key field and its value used as search criteria. **Notes** - Only exact matches are supported. - Key fields must be indexed, assuming that indexing is available for the database type of the connection. - Append multiple key-value pairs separated by an ampersand to add multiple search criteria. **Example** ``` ?{key_field_1}={value_1}&{key_field_2}={value_2} ```' required: true schema: type: string responses: '200': description: 200 OK content: application/json: schema: $ref: '#/components/schemas/rds-response200' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api tags: - Rds post: summary: Insert Records into an RDS Table description: 'Inserts the records into a custom table in the Relational Data Service (RDS). Records that violate any constraints on the table are ignored. For example, new records that have a conflicting primary key with an existing record are not inserted. > #### Watch Out! > > Only for Emarsys hosted databases. This feature is only available for subscribed customers. For further information, contact your account manager. **Note:** The maximum number of objects per request is 1000. ' operationId: insertRecordsIntoRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-200-error' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api requestBody: content: application/json: schema: type: array description: 'An array of objects that represent a record in the table. The elements of the object are key-value pairs. Key: Column name Value: Value of the record **Note:** You can specify multiple columns and records.' items: type: object x-examples: - - name: Joe age: 34 - name: Mary age: null tags: - Rds patch: summary: Update Records in an RDS Table description: 'Updates records in a custom table in the Relational Data Service (RDS) that match the specified criteria. > #### Watch Out! > > Only for Emarsys hosted databases. This feature is only available for subscribed customers. For further information, contact your account manager. **Note:** The maximum number of objects per request is 1000.' operationId: updateRecordsInRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-200-error' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api requestBody: content: application/json: schema: type: array description: 'An array of objects that represent a record in the table. **Note:** You can specify multiple columns and records.' items: type: object properties: search: type: object description: 'The match criteria for updating records represented as key-value pairs. Key: Column name Value: Value of the record' update: type: object description: 'The new values of the matched records represented as key-value pairs. Key: Column name Value: Value of the record **Note:** The match criteria and the records to update can be different.' required: - search - update x-examples: - - search: name: Joe age: 34 update: age: 35 color: red - search: name: Jack age: 10 update: age: 11 color: blue tags: - Rds put: summary: Replace an RDS Table description: 'Replaces a custom table with the provided records in the Relational Data Service (RDS). This feature is only available for subscribed customers. For further information, contact your account manager. > #### Watch Out! > > Only for Emarsys hosted databases. **Important:** This call deletes all previous records from the table. **Note:** The maximum number of objects per request is 1000. ' operationId: replaceRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-200-error' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api requestBody: content: application/json: schema: type: array description: 'An array of objects that represent a record in the table. The elements of the object are key-value pairs. Key: Column name Value: Value of the record **Note:** You can specify multiple columns and records.' items: type: object x-examples: - - name: Joe age: 34 - name: Mary age: null tags: - Rds /rds/connections/{connectionName}/tables/{tableName}/records/upsert: post: summary: Upsert Records in an RDS Table description: 'Inserts and updates records in a custom table in the Relational Data Service (RDS). This feature is only available for subscribed customers. For further information, contact your account manager. > #### Watch out! > > Only available for Emarsys hosted databases. **Notes** - The maximum number of objects per request is 1000. - Table structures are not returned on this endpoint. Therefore, you must know the primary key column(s) defined in the table you are accessing.' operationId: upsertRecordsInRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-200-error' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api requestBody: content: application/json: schema: type: array description: 'An array of objects that represent a record in the table. The elements of the object are key-value pairs. Key: Column name Value: Value of the record Each object must contain the following: | Name | Description | Comments | | --- | --- | --- | | Name of the primary key column(s) | The primary key(s) defined in the target table. | If the primary key already exists, updates the row with the provided data.
If the primary key does not exist, inserts a new row with the provided data.
You can specify the value of more than one column, if the target table has multiple primary keys. | | Name of the column(s) to upsert | The value of the new record. | You can specify the value of more than one column, and also more than one record in a request. |' items: type: object x-examples: - - id: 1 name: Joe age: 34 - id: 2 name: Mary age: null tags: - Rds /rds/connections/{connectionName}/tables/{tableName}/records/remove: post: summary: Delete Records from an RDS Table description: 'Deletes the records from a custom table in the Relational Data Service (RDS) that match the specified criteria. This feature is only available for subscribed customers. For further information, contact your account manager. > #### Watch Out! > > Only for Emarsys hosted databases. **Note:** The maximum number of objects per request is 1000.' operationId: deleteRecordsFromRdsTable parameters: - name: connectionName in: path description: The name of the connection to the Relational Data Service. required: true schema: type: string - name: tableName in: path description: The name of the table in the Relational Data Service. required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-200-error' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-400-error' '403': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-403-error' '404': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-404-error' '429': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-429-error' '500': description: '' content: application/json: schema: $ref: '#/components/schemas/rds-response-500-error' security: - X-WSSE: [] servers: - url: https://api.emarsys.net/api requestBody: content: application/json: schema: type: array description: 'An array of objects that represent a record in the table. The elements of the object are key-value pairs. Key: Column name Value: Value of the record **Note:** You can specify multiple columns and records.' items: type: object x-examples: - - name: Joe age: 34 - name: Mary age: null tags: - Rds components: schemas: rds-response200: type: object title: 200 OK response description: The requested records in JSON format. x-examples: - name: Joe age: 34 rds-response-500-error: type: object description: See the following document for a list of [http 500 errors](docs/response-codes/rd-500-errors.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [errors](docs/response-codes/rd-500-errors.md). replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK rds-response-403-error: type: object description: See the following document for a list of [http 403 errors](docs/response-codes/rd-403-errors.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [errors](docs/response-codes/rd-403-errors.md). replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK rds-response-400-error: type: object description: See the following document for a list of [http 400 errors](docs/response-codes/rd-400-errors.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [errors](docs/response-codes/rd-400-errors.md). replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK rds-response-429-error: type: object description: See the following document for a list of [http 429 errors](docs/response-codes/rd-429-errors.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [errors](docs/response-codes/rd-429-errors.md). replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK rds-response-200-error: type: object description: See the following document for a list of [http 200 responses](docs/response-codes/rd-200-responses.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [responses](docs/response-codes/rd-200-responses.md). default: 0 replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK rds-response-404-error: type: object description: See the following document for a list of [http 404 errors](docs/response-codes/rd-404-errors.md). properties: replyCode: type: integer description: The Emarsys reply code. Successful requests return *0*; otherwise, see [errors](docs/response-codes/rd-404-errors.md). replyText: type: string description: Additional information on the status of the request. x-examples: - replyCode: 0 replyText: OK securitySchemes: X-WSSE: type: apiKey name: X-WSSE in: header