Cloud Integration Hub > Cloud Integration Hub REST APIs > Publish Data REST API
  

Publish Data REST API

Use the Cloud Integration Hub Publish Data REST API to publish data transactions directly to a topic on the Cloud Integration Hub publication repository.
You can use the Publish Data API to publish data with publications that publish data directly to a topic with an API. You cannot use the API with publications that trigger a Data Integration task.
To publish data through the API, copy the URL of the API from the Publication page in Cloud Integration Hub.
Note: When you use a private publication repository, if you change the Secure Agent on which the publication repository service runs or the port number of the publication repository, the URL of the API changes accordingly. In this case, be sure to notify API users and consumers of the new URL.
Request Headers
Include the following headers in the request:
Accept - application/json
Content-Type - application/json
To support UTF-8 character encoding, for example, to use Japanese characters in table and column names, include the following headers in the request:
Accept-Charset: charset=utf-8
Content-Type: application/json;charset=utf-8
Request syntax
Use the following syntax to publish data directly to a topic:
{
"<table_name>":
[
{"<column_name>":"<data>"}
]
}
A topic table name must begin with an alphabetic character or underscore and can contain only ASCII alphanumeric characters or underscores. The name must be unique in the Cloud Integration Hub repository.
For example:
{
"Sales":
[
{"Opportunity_Name":"string”,"Opportunity_Owner_Id":"string"}
],
"Orders":
[
{"Account_Name":"string","Account_Id":"string","OrderId": "string"}
]
}
DATETIME field
If the topic to which you publish includes a DATETIME field, you must use the following format for the DATETIME value: yyyy-MM-dd HH:mm:ss.SSS.

Publish Data REST API Action Response

When you use the Cloud Integration Hub Publish Data REST API to publish data directly to a topic, Cloud Integration Hub returns the response code of the action that you perform in the REST API response.
Publishing data through the REST API returns one of the following response codes:

Topic Swagger Structure for Publish Data REST API

The Publish Data REST API returns the Swagger structure for the topic into which the publication publishes data.
To view the Swagger structure, copy the URL of the structure from the Publication page in Cloud Integration Hub.