Hub Import API
Purple Hub
API Request
The Purple Hub offers a REST API for importing articles with all connected metadata. For each Hub cluster, this data is required to perform the call:
Data | Description | Example |
Hub cluster domain | Determines the Hub cluster, data is imported to | demo.purpledshub.com |
Hub identifier | Determines the Hub instance, data is imported to | my-news-portal |
Authorization Token | Securing the call to import data | 4de214ac-cfdb-2154-11f2-10470a4bb5f1 |
Publication ID | References the feed, data is imported to | 3bca5bf2-425a-47ac-93f9-135ce05e117d |
The call is performed with the parameters above:
Request POST https://<hub-cluster-domain>/<hub-identifier>/wp-json/purple/v3/import
Headers Authorization: <authorization-token>
Post-Parameters post: <post-data>
Where post data is a JSON structure containing post content and metadata. The publication ID is also part of the post data, as outlined below.
JSON structure of “post” parameter
The property „assets“ is a list of URLs referencing assets (images, etc.) that appear in the content and have to be copied to the Purple HUB.
Example for a “post” parameter
Structure HTML Content
The actual content structure is reflected by the code view of the article in the Purple Hub, except for any unique purpleId attribute, which is not expected to be given.

Response Codes and Messages
Response for a succeeded call:
200 <post-id>
Responses for erroneous calls:
400 An unexpected error occurred while updating/inserting post: <error>
401 No authorization token was provided.
401 The authorization token is incorrect.
400 No JSON string was provided.
400 Could not decode JSON. Please check if the provded JSON is valid.
400 The JSON string contains no data. Nothing to do.
400 Missing post data.
400 Missing post title.
400 Missing post status.
400 The provided post status does not exist.
400 Missing post type.
400 The provided post type does not exist.
Schema for validating the API Input
In order to make sure, that the Input transferred through the API is correct, please use this json-schema attached here as a download.