Overview

You can use the SAP Analytics Hub RESTful web services to create and manage the asset lifecycle within the SAP Analytics Hub.

HTTP Methods

This REST API adheres to standard HTTP and REST conventions in the usage of HTTP methods.

Method Usage

GET

Used to retrieve a resource

POST

Used to create and update a resource

DELETE

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

200 OK

The request completed successfully.

409 Conflict

The request could not be completed due to a conflict.

400 Bad Request

The request was malformed. The response body includes an error providing further information.

404 Not Found

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

type

Number

The asset type

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

tags

Array

The asset tags

images

Array

The asset images

links

Array

The asset links

comment

String

Edition comment

layout

Object

The asset layout

layout.tileLayout

String

The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE)

teams

Array

The teams the asset belongs to

Response structure

Path Type Description

id

Number

The identifier of the draft

assetId

Null

The asset associated with the draft (if any)

type

Number

The asset type

createdBy

Object

The asset author

created

Number

The asset creation date

modifiedBy

Object

The asset last editor

lastModified

Number

The asset last update date

layout

Object

The asset layout

layout.tileLayout

Number

The identifier of the tile layout

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

images

Array

The asset images

links

Array

The asset links

tags

Array

The asset tags

status

String

The asset status

comment

Null

Edition comment

teams

Array

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

Table 1. /hub/api/v1/asset/draft/{draftId}
Parameter Description

draftId

The identifier of the draft

Response structure

Path Type Description

id

Number

The identifier of the draft

assetId

Null

The asset associated with the draft (if any)

type

Number

The asset type

createdBy

Object

The asset author

created

Number

The asset creation date

modifiedBy

Object

The asset last editor

lastModified

Number

The asset last update date

layout

Object

The asset layout

layout.tileLayout

Number

The identifier of the tile layout

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

images

Array

The asset images

links

Array

The asset links

tags

Array

The asset tags

status

String

The asset status

comment

Null

Edition comment

teams

Array

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

drafts

Array

The list of drafts

forReviewDrafts

Array

The list of drafts requesting a validation

rejectedDrafts

Array

The list of rejected drafts

retiredAssets

Array

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

Table 2. /hub/api/v1/asset/draft/{draftId}
Parameter Description

draftId

The identifier of the draft

Request structure

Path Type Description

type

Number

The asset type

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

tags

Array

The asset tags

images

Array

The asset images

links

Array

The asset links

comment

String

Edition comment

layout

Object

The asset layout

layout.tileLayout

String

The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE)

teams

Array

The teams the asset belongs to

Response structure

Path Type Description

id

Number

The identifier of the draft

assetId

Number

The asset associated with the draft (if any)

type

Number

The asset type

createdBy

Object

The asset author

created

Number

The asset creation date

modifiedBy

Object

The asset last editor

lastModified

Number

The asset last update date

layout

Object

The asset layout

layout.tileLayout

Number

The identifier of the tile layout

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

images

Array

The asset images

links

Array

The asset links

tags

Array

The asset tags

status

String

The asset status

comment

Object

Edition comment

teams

Array

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

Table 3. /hub/api/v1/asset/{assetId}/draft
Parameter Description

assetId

The asset identifier

Response structure

Path Type Description

id

Number

The identifier of the draft

assetId

Number

The asset associated with the draft (if any)

type

Number

The asset type

createdBy

Object

The asset author

created

Number

The asset creation date

modifiedBy

Object

The asset last editor

lastModified

Number

The asset last update date

layout

Object

The asset layout

layout.tileLayout

Number

The identifier of the tile layout

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

images

Array

The asset images

links

Array

The asset links

tags

Array

The asset tags

status

String

The asset status

comment

Object

Edition comment

teams

Array

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

Table 4. /hub/api/v1/asset/{assetId}/draft
Parameter Description

assetId

The identifier of the asset to be edited

Request structure

Path Type Description

status

String

The status for asset edition (draft)

comment

String

The comment associated to draft edition

Response structure

Path Type Description

id

Number

The identifier of the edited draft

assetId

Number

The identifier of the related asset (if any)

status

String

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

Table 5. /hub/api/v1/asset/draft/{draftId}/status
Parameter Description

draftId

The identifier of the draft

Request structure

Path Type Description

status

String

The new status for an edited draft (forReview, rejected, versioned)

comment

String

The comment associated to the validation request

Response structure

Path Type Description

id

Number

The identifier of the edited draft

assetId

Null

The identifier of the related asset (if any)

status

String

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

Table 6. /hub/api/v1/asset/draft/{draftId}/status
Parameter Description

draftId

The identifier of the draft

Request structure

Path Type Description

status

String

The new status for an edited draft (forReview, rejected, versioned)

comment

String

The comment associated to the validation request

Response structure

Path Type Description

id

Number

The identifier of the edited draft

assetId

Null

The identifier of the related asset (if any)

status

String

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

Table 7. /hub/api/v1/asset/draft/{draftId}/status
Parameter Description

draftId

The identifier of the draft

Request structure

Path Type Description

status

String

The new status for an edited draft (forReview, rejected, versioned)

comment

String

The comment associated to the validation request

Response structure

Path Type Description

id

Number

The identifier of the edited draft

assetId

Null

The identifier of the related asset (if any)

status

String

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

id

Number

The asset identifier

type

Number

The asset type

createdBy

Object

The asset author

created

Number

The asset creation date

modifiedBy

Object

The asset last editor

lastModified

Number

The asset last update date

layout

Object

The asset layout

layout.tileLayout

Number

The identifier of the tile layout

fields

Object

The values of an asset field

lovFields

Object

The values of an asset field (based on a list of values)

images

Array

The asset images

links

Array

The asset links

tags

Array

The asset tags

status

String

The asset status

viewCount

Number

The number of views for this asset

favorites

Array

The favorite groups for this asset

teams

Array

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

[].id

Number

The asset identifier

[].type

Number

The asset type

[].createdBy

Null

The asset author

[].created

Number

The asset creation date

[].modifiedBy

Null

The asset last editor

[].lastModified

Number

The asset last update date

[].layout

Object

The asset layout

[].layout.tileLayout

Number

The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE)

[].fields

Object

The values of an asset field

[].lovFields

Object

The values of an asset field (based on a list of values)

[].images

Array

The asset images

[].links

Array

The asset links

[].tags

Array

The asset tags

[].status

String

The asset status

[].viewCount

Number

The number of views for this asset

[].favorites

Array

The favorite groups for this asset

[].teams

Array

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

ids

Array

The identifiers of the assets to be duplicated

Response structure

Path Type Description

ids

Object

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

ids

Array

The identifiers of the drafts to be duplicated

Response structure

Path Type Description

ids

Object

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

id

Number

The image identifier

type

String

The image storing type (image | hostedContent)

title

String

The image title

url

String

The image URL

uuid

String

The unique identifier of the image

titles

Array

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

page

Number

Indicates the page (chunk of assets) to retrieve

limit

Number

Indicates the number of assets within the page

sortDirection

String

Indicates the sort direction (asc/desc) based on the creation date

Response structure

Path Type Description

[].id

Number

The asset identifier

[].type

Number

The asset type

[].createdBy

Object

The asset author

[].created

Number

The asset creation date

[].modifiedBy

Object

The asset last editor

[].lastModified

Number

The asset last update date

[].layout

Object

The asset layout

[].layout.tileLayout

Number

The layout mode used to display an asset in a tile view (NO_IMAGE|BIG_IMAGE|SMALL_IMAGE)

[].fields

Object

The values of an asset field

[].lovFields

Object

The values of an asset field (based on a list of values)

[].images

Array

The asset images

[].links

Array

The asset links

[].tags

Array

The asset tags

[].status

String

The asset status

[].viewCount

Number

The number of views for this asset

[].favorites

Array

The favorite groups for this asset

[].teams

Array

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

Table 8. /hub/api/v1/asset/draft/{draftId}
Parameter Description

draftId

The identifier of the draft to delete

Response structure

Path Type Description

id

Number

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

Table 9. /hub/api/v1/asset/{assetId}/draft
Parameter Description

assetId

The identifier of the asset to retire

Request structure

Path Type Description

status

String

The status for asset retirement (retired)

comment

String

The associated comment

Response structure

Path Type Description

id

Number

The identifier of the retired asset

status

String

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

Table 10. /hub/api/v1/asset/{assetId}/draft
Parameter Description

assetId

The identifier of the asset for which retirement must be cancelled

Request structure

Path Type Description

status

String

The status for asset retirement cancellation (live)

comment

String

The associated comment

Response structure

Path Type Description

id

Number

The identifier of the asset for which retirement has been cancelled

status

String

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

Table 11. /hub/api/v1/asset/{assetId}
Parameter Description

assetId

The identifier of the asset to delete

Response structure

Path Type Description

id

Number

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
}