Overview
HTTP Methods
This REST API adheres to standard HTTP and REST conventions in the usage of HTTP methods.
| Method | Usage |
|---|---|
|
|
Used to retrieve a resource |
|
|
Used to create and update a resource |
|
|
Used to delete an existing resource |
HTTP Status Codes
This REST API adheres to standard HTTP and REST conventions in the usage of HTTP status codes.
| Status Code | Usage |
|---|---|
|
|
The request completed successfully. |
|
|
The request could not be completed due to a conflict. |
|
|
The request was malformed. The response body includes an error providing further information. |
|
|
The requested resource did not exist. |
CSRF
In order to prevent Cross-Site Request Forgery (CSRF), Analytics Hub provides a standard security mechanism
based on a CSRF token.
Every POST or DELETE request should provide an X-CSRF-Token header
that is associated with the HTTP session.
To get this token, call any GET endpoint (e.g. /hub/api/v1/profile) with
X-CSRF-Token: Fetch.
SAP Analytics Hub API
This API exposes services that allow you to create, update, validate, and delete assets.
-
Creating a new asset
-
Managing the validation workflow of an asset (from draft to live)
-
Updating, retiring, and deleting an asset
Editing an Asset
You can create and manage assets through the following entry point:
-
/hub/api/v1/asset
Create a new draft
A POST request creates a new draft.
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The asset type |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset tags |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
Edition comment |
|
|
|
The asset layout |
|
|
|
The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE) |
|
|
|
The teams the asset belongs to |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the draft |
|
|
|
The asset associated with the draft (if any) |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The identifier of the tile layout |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
Edition comment |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"type" : 2,
"fields" : {
"6" : {
"values" : [ {
"value" : "My first asset"
} ]
},
"7" : {
"values" : [ {
"value" : "Full description of My first asset"
} ]
},
"8" : {
"values" : [ {
"value" : "Short desc of My first asset"
} ]
},
"9" : {
"values" : [ {
"value" : "First hidden tag of My first asset "
} ]
},
"10" : {
"values" : [ {
"value" : {
"title" : "wikipedia",
"url" : "https://www.wikipedia.org",
"type" : "external"
}
} ]
}
},
"lovFields" : {
"4" : {
"values" : [ {
"id" : 11
}, {
"id" : 13
} ]
},
"5" : {
"values" : [ {
"id" : 14
}, {
"id" : 16
} ]
},
"6" : {
"values" : [ {
"id" : 18
} ]
}
},
"images" : [ ],
"links" : [ {
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external"
}, {
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external"
} ],
"tags" : [ {
"title" : "First Tag"
}, {
"title" : "Second Tag"
} ],
"layout" : {
"tileLayout" : "NO_IMAGE"
},
"comment" : "Create a draft",
"teams" : [ ]
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 3812
{
"id" : 1,
"assetId" : null,
"type" : 2,
"lastModified" : 1536097479529,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"layout" : {
"tileLayout" : 7
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 1,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 2,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 2,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 3,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 4,
"value" : "First hidden tag of My first asset "
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 4,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 5,
"value" : {
"id" : 4,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia",
"url" : "https://www.wikipedia.org",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"isCore" : false,
"coreId" : 0,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"sortType" : "occurrence",
"values" : [ {
"id" : 11,
"value" : "First value"
}, {
"id" : 13,
"value" : "Third value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"sortType" : "occurrence",
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"sortType" : "occurrence",
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ ],
"links" : [ {
"id" : 1,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
}, {
"id" : 2,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
} ],
"tags" : [ {
"id" : 3,
"title" : "First Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "draft",
"comment" : null,
"teams" : [ ]
}
Retrieve a draft
A GET request fetches a specific draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the draft |
|
|
|
The asset associated with the draft (if any) |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The identifier of the tile layout |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
Edition comment |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/1' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 3812
{
"id" : 1,
"assetId" : null,
"type" : 2,
"lastModified" : 1536097479529,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"layout" : {
"tileLayout" : 7
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 1,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 2,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 2,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 3,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 4,
"value" : "First hidden tag of My first asset "
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 4,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 5,
"value" : {
"id" : 4,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia",
"url" : "https://www.wikipedia.org",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"isCore" : false,
"coreId" : 0,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"sortType" : "occurrence",
"values" : [ {
"id" : 11,
"value" : "First value"
}, {
"id" : 13,
"value" : "Third value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"sortType" : "occurrence",
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"sortType" : "occurrence",
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ ],
"links" : [ {
"id" : 1,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
}, {
"id" : 2,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
} ],
"tags" : [ {
"id" : 3,
"title" : "First Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "draft",
"comment" : null,
"teams" : [ ]
}
List all existing drafts, draft to be validated, rejected drafts, and retired assets.
A GET request lists all kinds of asset drafts.
Request parameter
-
status: draft | forReview | rejected | retired
For each provided status, the corresponding list of assets is returned. Not required: by default, the full list is returned.
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The list of drafts |
|
|
|
The list of drafts requesting a validation |
|
|
|
The list of rejected drafts |
|
|
|
The list of retired assets |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 3043
{
"drafts" : [ {
"id" : 1,
"assetId" : null,
"type" : 2,
"lastModified" : 1536097479529,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"layout" : {
"tileLayout" : 7
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 1,
"title" : "Title"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 3,
"title" : "Short Description"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"sortType" : "occurrence",
"values" : [ {
"id" : 11,
"value" : "First value"
}, {
"id" : 13,
"value" : "Third value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"sortType" : "occurrence",
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"sortType" : "occurrence",
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ ],
"links" : [ {
"id" : 1,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
}, {
"id" : 2,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
} ],
"tags" : [ {
"id" : 3,
"title" : "First Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "draft",
"comment" : null,
"teams" : [ ]
} ],
"forReviewDrafts" : [ ],
"rejectedDrafts" : [ ],
"retiredAssets" : [ ]
}
Update an existing draft
A POST request updates a draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The asset type |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset tags |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
Edition comment |
|
|
|
The asset layout |
|
|
|
The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE) |
|
|
|
The teams the asset belongs to |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the draft |
|
|
|
The asset associated with the draft (if any) |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The identifier of the tile layout |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
Edition comment |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/2' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"type" : 2,
"fields" : {
"6" : {
"values" : [ {
"id" : 6,
"value" : "My first asset is updated"
} ]
},
"7" : {
"values" : [ {
"id" : 7,
"value" : "Full description of My first asset"
} ]
},
"8" : {
"values" : [ {
"id" : 8,
"value" : "Short desc of My first asset is updated"
} ]
},
"9" : {
"values" : [ {
"id" : 9,
"value" : "First hidden tag of My first asset is updated"
} ]
},
"10" : {
"values" : [ {
"id" : 10,
"value" : {
"id" : 8,
"title" : "wikipedia welcome",
"url" : "https://en.wikipedia.org/wiki/Main_Page",
"type" : "external"
}
} ]
}
},
"lovFields" : {
"4" : {
"values" : [ {
"id" : 13
}, {
"id" : 12
} ]
}
},
"images" : [ {
"id" : 7,
"title" : "First image",
"url" : "3de7ea92-95f4-4bf2-b675-2807033862db",
"type" : "hostedContent"
} ],
"links" : [ {
"title" : "Third Url",
"url" : "http://www.sap.com",
"type" : "external"
}, {
"id" : 6,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external"
}, {
"id" : 5,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external"
} ],
"tags" : [ {
"title" : "Third Tag"
}, {
"id" : 2
} ],
"layout" : {
"tileLayout" : "SMALL_IMAGE"
},
"comment" : "Update the draft",
"teams" : [ {
"id" : 1
} ]
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 4709
{
"id" : 2,
"assetId" : 1,
"type" : 2,
"lastModified" : 1536097480751,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"layout" : {
"tileLayout" : 9
},
"fields" : {
"6" : {
"values" : [ {
"id" : 6,
"value" : "My first asset is updated"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 1,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 7,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 2,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 8,
"value" : "Short desc of My first asset is updated"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 3,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 9,
"value" : "First hidden tag of My first asset is updated"
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 4,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 10,
"value" : {
"id" : 8,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia welcome",
"url" : "https://en.wikipedia.org/wiki/Main_Page",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia welcome"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"isCore" : false,
"coreId" : 0,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"sortType" : "occurrence",
"values" : [ {
"id" : 13,
"value" : "Third value"
}, {
"id" : 12,
"value" : "Second value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"sortType" : "occurrence",
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"sortType" : "occurrence",
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ {
"id" : 7,
"title" : "First image",
"url" : "3de7ea92-95f4-4bf2-b675-2807033862db",
"type" : "hostedContent",
"uuid" : "b61eaac8-122e-4093-a431-0d6fbfe43597",
"titles" : [ ]
} ],
"links" : [ {
"id" : 9,
"title" : "Third Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "1efaf548-5ff0-48f3-8b45-d5a60991c1d0",
"titles" : [ {
"languageId" : 2,
"title" : "Third Url"
} ]
}, {
"id" : 6,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
}, {
"id" : 5,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
} ],
"tags" : [ {
"id" : 4,
"title" : "Third Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "draft",
"comment" : {
"user" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"date" : 1536097480751,
"comment" : "Update the draft"
},
"teams" : [ {
"id" : 1,
"platformId" : "DemoTeam",
"title" : "DemoTeam"
} ]
}
Get a draft that belongs to an asset
A 'GET' request to get a draft given the asset ID that the draft is tied to.
Path parameters
| Parameter | Description |
|---|---|
|
|
The asset identifier |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the draft |
|
|
|
The asset associated with the draft (if any) |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The identifier of the tile layout |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
Edition comment |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1/draft' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 4067
{
"id" : 2,
"assetId" : 1,
"type" : 2,
"lastModified" : 1536097480401,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"layout" : {
"tileLayout" : 7
},
"fields" : {
"6" : {
"values" : [ {
"id" : 6,
"value" : "My first asset"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 1,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 7,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 2,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 8,
"value" : "Short desc of My first asset"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 3,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 9,
"value" : "First hidden tag of My first asset "
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"isCore" : true,
"coreId" : 4,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 10,
"value" : {
"id" : 8,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia",
"url" : "https://www.wikipedia.org",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"isCore" : false,
"coreId" : 0,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"sortType" : "occurrence",
"values" : [ {
"id" : 11,
"value" : "First value"
}, {
"id" : 13,
"value" : "Third value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"sortType" : "occurrence",
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"sortType" : "occurrence",
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ ],
"links" : [ {
"id" : 5,
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
}, {
"id" : 6,
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
} ],
"tags" : [ {
"id" : 3,
"title" : "First Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "draft",
"comment" : {
"user" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"date" : 1536097480427,
"comment" : "Edit live asset"
},
"teams" : [ ]
}
Edit an existing asset
A POST request edits an asset. A draft corresponding to the specified asset is created.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the asset to be edited |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The status for asset edition (draft) |
|
|
|
The comment associated to draft edition |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the edited draft |
|
|
|
The identifier of the related asset (if any) |
|
|
|
The new status of the edited draft (forReview, rejected) |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1/draft' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"status" : "draft",
"comment" : "Edit live asset"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 57
{
"id" : 2,
"status" : "draft",
"assetId" : 1
}
Review a draft
A POST request asks for the review of a draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The new status for an edited draft (forReview, rejected, versioned) |
|
|
|
The comment associated to the validation request |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the edited draft |
|
|
|
The identifier of the related asset (if any) |
|
|
|
The new status of the edited draft (forReview, rejected) |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/1/status' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"status" : "forReview",
"comment" : "My first request 'forReview'"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 64
{
"id" : 1,
"status" : "forReview",
"assetId" : null
}
Reject a draft
A POST request asks for the rejection of a draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The new status for an edited draft (forReview, rejected, versioned) |
|
|
|
The comment associated to the validation request |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the edited draft |
|
|
|
The identifier of the related asset (if any) |
|
|
|
The new status of the edited draft (forReview, rejected) |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/1/status' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"status" : "rejected",
"comment" : "My first request 'rejected'"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 63
{
"id" : 1,
"status" : "rejected",
"assetId" : null
}
Validate a draft
A POST request asks for the validation of a draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The new status for an edited draft (forReview, rejected, versioned) |
|
|
|
The comment associated to the validation request |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the edited draft |
|
|
|
The identifier of the related asset (if any) |
|
|
|
The new status of the edited draft (forReview, rejected) |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/1/status' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"status" : "live",
"comment" : "My first request 'live'"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 59
{
"id" : 1,
"status" : "live",
"assetId" : null
}
Retrieve an asset
A GET request fetches the specified asset.
Request parameter
-
recordUsage: Indicates if the usage must be recorded. True by default.
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The asset identifier |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The identifier of the tile layout |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
The number of views for this asset |
|
|
|
The favorite groups for this asset |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 4154
{
"id" : 1,
"type" : 2,
"lastModified" : 1536097481306,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"viewCount" : 0,
"layout" : {
"tileLayout" : 9
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset is updated"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 2,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset is updated"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 4,
"value" : "First hidden tag of My first asset is updated"
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 5,
"value" : {
"id" : 4,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia welcome",
"url" : "https://en.wikipedia.org/wiki/Main_Page",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia welcome"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"values" : [ {
"id" : 13,
"value" : "Third value"
}, {
"id" : 12,
"value" : "Second value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ {
"id" : 6,
"uuid" : "b61eaac8-122e-4093-a431-0d6fbfe43597",
"title" : "First image",
"url" : "3de7ea92-95f4-4bf2-b675-2807033862db",
"type" : "hostedContent",
"titles" : [ ]
} ],
"links" : [ {
"id" : 5,
"uuid" : "1efaf548-5ff0-48f3-8b45-d5a60991c1d0",
"title" : "Third Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Third Url"
} ]
}, {
"id" : 2,
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
}, {
"id" : 1,
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
} ],
"favorites" : [ ],
"tags" : [ {
"id" : 4,
"title" : "Third Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "live",
"teams" : [ {
"id" : 1,
"platformId" : "DemoTeam",
"title" : "DemoTeam"
} ]
}
Retrieve recently used assets
A GET request fetches the recently used assets.
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The asset identifier |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE) |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
The number of views for this asset |
|
|
|
The favorite groups for this asset |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/recent' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 2799
[ {
"id" : 1,
"type" : 2,
"lastModified" : 1536097481306,
"created" : 1536097479529,
"createdBy" : null,
"modifiedBy" : null,
"viewCount" : 1,
"layout" : {
"tileLayout" : 9
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset is updated"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"title" : "Title"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset is updated"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"title" : "Short Description"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"values" : [ {
"id" : 13,
"value" : "Third value"
}, {
"id" : 12,
"value" : "Second value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ {
"id" : 6,
"uuid" : "b61eaac8-122e-4093-a431-0d6fbfe43597",
"title" : "First image",
"url" : "3de7ea92-95f4-4bf2-b675-2807033862db",
"type" : "hostedContent",
"titles" : [ ]
} ],
"links" : [ {
"id" : 5,
"uuid" : "1efaf548-5ff0-48f3-8b45-d5a60991c1d0",
"title" : "Third Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Third Url"
} ]
}, {
"id" : 2,
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
}, {
"id" : 1,
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
} ],
"favorites" : [ ],
"tags" : [ {
"id" : 4,
"title" : "Third Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "live",
"teams" : [ {
"id" : 1,
"platformId" : "DemoTeam",
"title" : "DemoTeam"
} ]
} ]
Duplicate an asset
The result of the duplication of an asset is the creation of a new asset with the same content than the duplicated asset.
A POST request duplicates an asset.
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifiers of the assets to be duplicated |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
Mapping between identifiers of the assets to be duplicated and identifiers of the new drafts |
Example request
$ curl '{server hostname}/hub/api/v1/asset/copy' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"ids" : [ 1 ]
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 35
{
"ids" : {
"1" : 3
}
}
Duplicate a draft
The result of the duplication of a draft is the creation of a new draft with the same content than the duplicated draft.
A POST request duplicates a draft.
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifiers of the drafts to be duplicated |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
Mapping between identifiers of the drafts to be duplicated and identifiers of the new drafts |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/copy' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"ids" : [ 3 ]
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 35
{
"ids" : {
"3" : 4
}
}
Add an image to a draft
A POST request adds an image to a draft.
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The image identifier |
|
|
|
The image storing type (image | hostedContent) |
|
|
|
The image title |
|
|
|
The image URL |
|
|
|
The unique identifier of the image |
|
|
|
The different localized image titles |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/5/image' -i -X POST \
-H 'Content-Type: multipart/form-data' \
-F 'file=@image;type=image/jpg'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 190
{
"id" : 31,
"title" : "image",
"url" : "a8fccf97-7dba-4b7f-8600-0b981535a69a",
"type" : "hostedContent",
"uuid" : "290e5d38-5094-4056-b1ab-8a47c34e262a",
"titles" : [ ]
}
Get the created assets
Returns all assets created by the current user.
A POST request retrieves the created assets.
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
Indicates the page (chunk of assets) to retrieve |
|
|
|
Indicates the number of assets within the page |
|
|
|
Indicates the sort direction (asc/desc) based on the creation date |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The asset identifier |
|
|
|
The asset type |
|
|
|
The asset author |
|
|
|
The asset creation date |
|
|
|
The asset last editor |
|
|
|
The asset last update date |
|
|
|
The asset layout |
|
|
|
The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE) |
|
|
|
The values of an asset field |
|
|
|
The values of an asset field (based on a list of values) |
|
|
|
The asset images |
|
|
|
The asset links |
|
|
|
The asset tags |
|
|
|
The asset status |
|
|
|
The number of views for this asset |
|
|
|
The favorite groups for this asset |
|
|
|
The teams the asset belongs to |
Example request
$ curl '{server hostname}/hub/api/v1/asset/created' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sortDirection" : "desc",
"page" : 0,
"limit" : 5
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 4158
[ {
"id" : 1,
"type" : 2,
"lastModified" : 1536097481306,
"created" : 1536097479529,
"createdBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"modifiedBy" : {
"id" : 1000,
"corpId" : "I000000",
"firstName" : "John",
"lastName" : "Core",
"avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
},
"viewCount" : 0,
"layout" : {
"tileLayout" : 9
},
"fields" : {
"6" : {
"values" : [ {
"id" : 1,
"value" : "My first asset is updated"
} ],
"id" : 6,
"dataType" : "string",
"multi" : false,
"title" : "Title"
},
"7" : {
"values" : [ {
"id" : 2,
"value" : "Full description of My first asset"
} ],
"id" : 7,
"dataType" : "string",
"multi" : false,
"title" : "Description"
},
"8" : {
"values" : [ {
"id" : 3,
"value" : "Short desc of My first asset is updated"
} ],
"id" : 8,
"dataType" : "string",
"multi" : false,
"title" : "Short Description"
},
"9" : {
"values" : [ {
"id" : 4,
"value" : "First hidden tag of My first asset is updated"
} ],
"id" : 9,
"dataType" : "string",
"multi" : false,
"title" : "Hidden tags"
},
"10" : {
"values" : [ {
"id" : 5,
"value" : {
"id" : 4,
"uuid" : "e67b3b3e-2843-43a6-b846-6202b15718de",
"title" : "wikipedia welcome",
"url" : "https://en.wikipedia.org/wiki/Main_Page",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "wikipedia welcome"
} ]
}
} ],
"id" : 10,
"dataType" : "link",
"multi" : true,
"title" : "A new link field"
}
},
"lovFields" : {
"4" : {
"id" : 4,
"title" : "List Of Values - Field",
"multi" : true,
"lovId" : 4,
"values" : [ {
"id" : 13,
"value" : "Third value"
}, {
"id" : 12,
"value" : "Second value"
} ]
},
"5" : {
"id" : 5,
"title" : "Facet color - Field",
"multi" : true,
"lovId" : 5,
"values" : [ {
"id" : 14,
"value" : "Blue"
}, {
"id" : 16,
"value" : "Red"
} ]
},
"6" : {
"id" : 6,
"title" : "Facet country - Field",
"multi" : true,
"lovId" : 6,
"values" : [ {
"id" : 18,
"value" : "France"
} ]
}
},
"images" : [ {
"id" : 6,
"uuid" : "b61eaac8-122e-4093-a431-0d6fbfe43597",
"title" : "First image",
"url" : "3de7ea92-95f4-4bf2-b675-2807033862db",
"type" : "hostedContent",
"titles" : [ ]
} ],
"links" : [ {
"id" : 5,
"uuid" : "1efaf548-5ff0-48f3-8b45-d5a60991c1d0",
"title" : "Third Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Third Url"
} ]
}, {
"id" : 2,
"uuid" : "c0de59fe-50d0-43c4-ad3b-4d5cafa3205b",
"title" : "Second Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "Second Url"
} ]
}, {
"id" : 1,
"uuid" : "093aaa3d-b1ed-41ef-83b8-ea520236131a",
"title" : "First Url",
"url" : "http://www.sap.com",
"type" : "external",
"titles" : [ {
"languageId" : 2,
"title" : "First Url"
} ]
} ],
"favorites" : [ ],
"tags" : [ {
"id" : 4,
"title" : "Third Tag"
}, {
"id" : 2,
"title" : "Second Tag"
} ],
"status" : "live",
"teams" : [ {
"id" : 1,
"platformId" : "DemoTeam",
"title" : "DemoTeam"
} ]
} ]
Delete a draft
A DELETE request deletes a specific draft.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the draft to delete |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the deleted draft |
Example request
$ curl '{server hostname}/hub/api/v1/asset/draft/4' -i -X DELETE \
-H 'Content-Type: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 16
{
"id" : 4
}
Retire an asset
A POST request retires an asset.
Request parameter
-
force: False by default. If true, a draft referencing the specified asset is deleted.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the asset to retire |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The status for asset retirement (retired) |
|
|
|
The associated comment |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the retired asset |
|
|
|
The new status of the asset |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1/draft' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"status" : "retired",
"comment" : "Retire my asset"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 41
{
"id" : 1,
"status" : "retired"
}
Cancel an asset retirement
A POST request cancels an asset retirement.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the asset for which retirement must be cancelled |
Request structure
| Path | Type | Description |
|---|---|---|
|
|
|
The status for asset retirement cancellation (live) |
|
|
|
The associated comment |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the asset for which retirement has been cancelled |
|
|
|
The new status of the asset |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1/draft' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"status" : "live",
"comment" : "Cancel my asset retirement"
}'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 38
{
"id" : 1,
"status" : "live"
}
Delete an asset
A DELETE request deletes a specific asset.
Only retired assets can be deleted.
Request parameter
-
force: False by default. If true, a draft referencing the specified asset is also deleted.
Path parameters
| Parameter | Description |
|---|---|
|
|
The identifier of the asset to delete |
Response structure
| Path | Type | Description |
|---|---|---|
|
|
|
The identifier of the deleted asset |
Example request
$ curl '{server hostname}/hub/api/v1/asset/1' -i -X DELETE \
-H 'Content-Type: application/json'
Example response
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 16
{
"id" : 1
}