HTTP POST (create)
- Last Updated: March 6, 2025
- 2 minute read
- Hybrid Data Pipeline
- Version 4.6
- Documentation
Purpose
Create an entity in an existing entity collection — a table or object
in the underlying data store. The body of the POST request describes the entity to
be created and can be specified in the JSON OData format. Use the Content-Type header to specify the format.
- Values for all required properties, which include those that map to an updateable column in the data store that is defined as NOT NULL, that does not have a default value, and is not automatically generated by the data source.
- Optionally, include values for property values that cannot be updated. However, in this release, Hybrid Data Pipeline ignores these values.
- Optionally, specify values for navigation properties to create a relationship with other records.
URL
https://<myserver>:<port>/api/odata4/<data source name>/<entity collection path>
where <myserver> is the DSN name or the IP address of the machine where Hybrid Data Pipeline is installed.
Method
POST
Response
The body of the response contains the value of the new entity in the same format in which the entity definition was provided in the request. The entity value returned includes the correct values for any computed or auto-generated properties, and the Location header. The value of the Location header is the URL of the entity inserted. For example, the location header for the entity created in the preceding example may have the value.
https://myserver:8080/api/odata4/myoracle/Products(10)
Response Status
If the entity is created successfully, the OData service returns a
201 Created status. The body of the response
contains the value of the new entity in the same format as the entity definition
provided in the request. The entity value returned includes the correct values for
any computed or auto-generated properties, as well as the Location header, which contains the URL of the entity created
If the value for a required property is omitted from the entity
description, the OData service returns a 400 Bad Request
response. The message provides an indication of which required property was
not specified.
Authentication
Basic Authentication using the Hybrid Data Pipeline user ID and password. The credentials used for the request must be the same credentials used to create the Data Source definition.
Authorization
Any active Hybrid Data Pipeline user. The authenticated user must use same credentials used to create the Data Source definition.
Sample Request Payload
The following example creates a new Product entity in an Oracle data source.
POST https://myserver:8080/api/odata4/myoracle/Products
{
"ID" : 10, "Name" : "Hosta",
"Description" : "With new features",
"ReleaseDate" : "\/Date(1436342315266)\/",
"Rating" : 1,
"Price" : "1.23"
}