Overview

SAP Analytics Hub RESTful web service for interacting with a store.

HTTP verbs

This RESTful API tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb 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 RESTful API tries to adhere as closely as possible to standard HTTP and REST conventions in its use 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 will include 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 a 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.

Analytics Hub API

The purpose of the API is to expose services used to interact with a store

  • Get store configuration

  • Update store branding

  • Manage picked assets

  • Manage favorites

  • Search for assets

  • Suggest words

  • User profile

  • Manage store maintenance

Store configuration

You can retrieve a store configuration through the following entry point:

  • /hub/api/v1/config to get the store configuration

Retrieve the store configuation

A GET request will fetch the store configuration.

Response structure

Path Type Description

layouts

Object

Layouts of the store

Example request

$ curl '{server hostname}/hub/api/v1/config' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1752

{
  "layouts" : {
    "1" : {
      "id" : 1,
      "type" : "facet",
      "assetType" : null,
      "content" : {
        "facetOrder" : [ 2, 3 ]
      }
    },
    "2" : {
      "id" : 2,
      "type" : "application",
      "assetType" : null,
      "content" : { }
    },
    "7" : {
      "id" : 7,
      "type" : "tile",
      "assetType" : 2,
      "content" : {
        "type" : "NO_IMAGE",
        "title" : {
          "type" : "field",
          "value" : 5
        },
        "shortDescription" : {
          "type" : "field",
          "value" : 7
        }
      }
    },
    "8" : {
      "id" : 8,
      "type" : "tile",
      "assetType" : 2,
      "content" : {
        "type" : "BIG_IMAGE",
        "title" : {
          "type" : "field",
          "value" : 5
        },
        "shortDescription" : {
          "type" : "field",
          "value" : 7
        }
      }
    },
    "9" : {
      "id" : 9,
      "type" : "tile",
      "assetType" : 2,
      "content" : {
        "type" : "SMALL_IMAGE",
        "title" : {
          "type" : "field",
          "value" : 5
        },
        "shortDescription" : {
          "type" : "field",
          "value" : 7
        }
      }
    },
    "10" : {
      "id" : 10,
      "type" : "detail",
      "assetType" : 2,
      "content" : {
        "title" : {
          "type" : "field",
          "value" : 5
        },
        "shortDescription" : {
          "type" : "field",
          "value" : 7
        },
        "sections" : [ {
          "fields" : [ {
            "type" : "field",
            "value" : 6
          } ],
          "title" : "Description"
        } ]
      }
    }
  }
}

User profile

You can retrieve the user profile through the following entry point:

  • /hub/api/v1/profile to get the user profile

Retrieve the user profile

A GET request will fetch the user profile.

Response structure

Path Type Description

id

Number

Identifier of the user

corpId

String

Corporate identifier of the user

firstName

String

First name of the user

lastName

String

Last name of the user

avatar

String

Avatar (URL) of the user

roles

Array

Roles of the user

Example request

$ curl '{server hostname}/hub/api/v1/profile' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 207

{
  "id" : 1,
  "corpId" : "I000000",
  "firstName" : "John",
  "lastName" : "Dev",
  "avatar" : "https://avatars.wdf.sap.corp/avatar/unknown",
  "roles" : [ "TenantOperator", "ChiefContentEditor" ]
}

Picked asset

You can manage picked assets through the following entry point:

  • /hub/api/v1/picked to manage picked assets

Retrieve all picked assets

A GET request will fetch all picket assets.

Response structure

Path Type Description

[].asset

Object

Picked asset

[].pickedDate

Number

Date when the asset has been picked

Example request

$ curl '{server hostname}/hub/api/v1/picked' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2637

[ {
  "asset" : {
    "id" : 2,
    "type" : 2,
    "lastModified" : 1493902670579,
    "created" : 1493902670579,
    "createdBy" : null,
    "modifiedBy" : null,
    "viewCount" : 0,
    "layout" : {
      "tileLayout" : 9,
      "content" : {
        "properties" : { }
      }
    },
    "fields" : {
      "5" : {
        "id" : 5,
        "dataType" : "string",
        "multi" : false,
        "title" : "Title",
        "values" : [ {
          "id" : 5,
          "value" : "Copy of My first asset is updated"
        } ]
      },
      "7" : {
        "id" : 7,
        "dataType" : "string",
        "multi" : false,
        "title" : "Short Description",
        "values" : [ {
          "id" : 7,
          "value" : "Short desc of My first asset is updated"
        } ]
      }
    },
    "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" : 10,
      "uuid" : "2b46b20f-7d68-4b29-b24b-1c25de19cc41",
      "title" : "Second image",
      "url" : "IMAGE_TEST.jpg",
      "type" : "image"
    } ],
    "links" : [ {
      "id" : 7,
      "uuid" : "127533a6-dee8-44f5-99c1-1f283f8c1bd7",
      "title" : "Third Url",
      "url" : "http://www.sap.com",
      "type" : "external"
    }, {
      "id" : 8,
      "uuid" : "7c8afd98-45bd-45cc-af40-1ef60d8fc263",
      "title" : "Second Url",
      "url" : "http://www.sap.com",
      "type" : "external"
    }, {
      "id" : 9,
      "uuid" : "33b7d37b-6f9d-40b8-9320-6c9f592f5e96",
      "title" : "First Url",
      "url" : "http://www.sap.com",
      "type" : "external"
    } ],
    "favorites" : [ ],
    "tags" : [ {
      "id" : 4,
      "title" : "Third Tag"
    }, {
      "id" : 2,
      "title" : "Second Tag"
    } ],
    "status" : "live"
  },
  "pickedDate" : 1493902671711
} ]

Pick an asset

A POST request is used to pick an asset.

Path parameters

Table 1. /hub/api/v1/picked/{assetId}
Parameter Description

assetId

Identifier of the asset to be picked

Response structure

Path Type Description

id

Number

Identifier of the picked asset

Example request

$ curl '{server hostname}/hub/api/v1/picked/2' -i -X POST -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 16

{
  "id" : 2
}

Remove a picked asset

A DELETE request is used to remove a picked asset.

Path parameters

Table 2. /hub/api/v1/picked/{assetId}
Parameter Description

assetId

Identifier of the asset to be removed from picked assets

Response structure

Path Type Description

id

Number

Identifier of the asset removed from picked assets

Example request

$ curl '{server hostname}/hub/api/v1/picked/2' -i -X DELETE -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 16

{
  "id" : 2
}

Favorite asset

You can manage favorite assets through the following entry point:

  • /hub/api/v1/favorite to manage favorite assets

Retrieve all favorite assets

A GET request will fetch all favorite assets.

Response structure

Path Type Description

My_favorites_group

Array

Favorites within the defined group

Example request

$ curl '{server hostname}/hub/api/v1/favorite' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3016

{
  "My_favorites_group" : [ {
    "id" : 1,
    "asset" : {
      "id" : 2,
      "type" : 2,
      "lastModified" : 1493902670579,
      "created" : 1493902670579,
      "createdBy" : null,
      "modifiedBy" : null,
      "viewCount" : 0,
      "layout" : {
        "tileLayout" : 9,
        "content" : {
          "properties" : { }
        }
      },
      "fields" : {
        "5" : {
          "id" : 5,
          "dataType" : "string",
          "multi" : false,
          "title" : "Title",
          "values" : [ {
            "id" : 5,
            "value" : "Copy of My first asset is updated"
          } ]
        },
        "7" : {
          "id" : 7,
          "dataType" : "string",
          "multi" : false,
          "title" : "Short Description",
          "values" : [ {
            "id" : 7,
            "value" : "Short desc of My first asset is updated"
          } ]
        }
      },
      "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" : 10,
        "uuid" : "2b46b20f-7d68-4b29-b24b-1c25de19cc41",
        "title" : "Second image",
        "url" : "IMAGE_TEST.jpg",
        "type" : "image"
      } ],
      "links" : [ {
        "id" : 7,
        "uuid" : "127533a6-dee8-44f5-99c1-1f283f8c1bd7",
        "title" : "Third Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      }, {
        "id" : 8,
        "uuid" : "7c8afd98-45bd-45cc-af40-1ef60d8fc263",
        "title" : "Second Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      }, {
        "id" : 9,
        "uuid" : "33b7d37b-6f9d-40b8-9320-6c9f592f5e96",
        "title" : "First Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      } ],
      "favorites" : [ {
        "id" : 1,
        "assetId" : 2,
        "group" : "My_favorites_group"
      } ],
      "tags" : [ {
        "id" : 4,
        "title" : "Third Tag"
      }, {
        "id" : 2,
        "title" : "Second Tag"
      } ],
      "status" : "live"
    },
    "date" : 1493902671790,
    "title" : null
  } ]
}

Retrieve top n favorites by creation date

A GET request will fetch top n favorites by creation date.

Request parameter

  • limit: 10 by default. Number of favorites to retrieve.

Response structure

Path Type Description

My_favorites_group

Array

Favorites within the defined group

Example request

$ curl '{server hostname}/hub/api/v1/favorite/top?limit=1?limit=1' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3016

{
  "My_favorites_group" : [ {
    "id" : 1,
    "asset" : {
      "id" : 2,
      "type" : 2,
      "lastModified" : 1493902670579,
      "created" : 1493902670579,
      "createdBy" : null,
      "modifiedBy" : null,
      "viewCount" : 0,
      "layout" : {
        "tileLayout" : 9,
        "content" : {
          "properties" : { }
        }
      },
      "fields" : {
        "5" : {
          "id" : 5,
          "dataType" : "string",
          "multi" : false,
          "title" : "Title",
          "values" : [ {
            "id" : 5,
            "value" : "Copy of My first asset is updated"
          } ]
        },
        "7" : {
          "id" : 7,
          "dataType" : "string",
          "multi" : false,
          "title" : "Short Description",
          "values" : [ {
            "id" : 7,
            "value" : "Short desc of My first asset is updated"
          } ]
        }
      },
      "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" : 10,
        "uuid" : "2b46b20f-7d68-4b29-b24b-1c25de19cc41",
        "title" : "Second image",
        "url" : "IMAGE_TEST.jpg",
        "type" : "image"
      } ],
      "links" : [ {
        "id" : 7,
        "uuid" : "127533a6-dee8-44f5-99c1-1f283f8c1bd7",
        "title" : "Third Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      }, {
        "id" : 8,
        "uuid" : "7c8afd98-45bd-45cc-af40-1ef60d8fc263",
        "title" : "Second Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      }, {
        "id" : 9,
        "uuid" : "33b7d37b-6f9d-40b8-9320-6c9f592f5e96",
        "title" : "First Url",
        "url" : "http://www.sap.com",
        "type" : "external"
      } ],
      "favorites" : [ {
        "id" : 1,
        "assetId" : 2,
        "group" : "My_favorites_group"
      } ],
      "tags" : [ {
        "id" : 4,
        "title" : "Third Tag"
      }, {
        "id" : 2,
        "title" : "Second Tag"
      } ],
      "status" : "live"
    },
    "date" : 1493902671790,
    "title" : null
  } ]
}

Define asset as favorite

A POST request is used to define an asset as favorite.

Path parameters

Unresolved directive in manageStore.adoc - include::C:\git\eos\eos-backend\server-test\target/generated-snippets/addFavoriteAsset/path-parameters.adoc[]

Response structure

Path Type Description

[].id

Number

Identifier of the favorite

[].assetId

Number

Identifier of the asset defined as favorite

[].group

String

Group of the asset defined as favorite

Example request

$ curl '{server hostname}/hub/api/v1/favorite' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '[ {
  "assetId" : 2,
  "group" : "My_favorites_group"
} ]'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 73

[ {
  "id" : 1,
  "assetId" : 2,
  "group" : "My_favorites_group"
} ]

Remove an asset from favorites

A DELETE request is used to remove an asset from favorites.

Path parameters

Table 3. /hub/api/v1/favorite/{id}
Parameter Description

id

Identifier of the favorite to remove

Response structure

Path Type Description

id

Number

Identifier of the removed favorite

Example request

$ curl '{server hostname}/hub/api/v1/favorite/1' -i -X DELETE -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 16

{
  "id" : 1
}

You can search assets through the following entry point:

  • /hub/api/v1/search to search assets

Search asset

A POST request is used to search asset.

Request structure

Path Type Description

keywords

String

Search keywords

sortCriteria

String

Sort criteria (title|viewCount|creationDate)

sortDirection

String

Sort direction (asc|desc)

page

Number

Number of the page (chunck of assets) to retrieve

limit

Number

Number of asset by page

showFacets

Boolean

If true, facets are returned

showAssets

Boolean

If true, found assets are returned

showTags

Boolean

If true, tags are returned

selectedFacets

Object

List of selected facet values

selectedFields

Array

List of searchable fields

selectedTags

Array

List of selected tags

Response structure

Path Type Description

assets

Array

List of found assets

assetCount

Number

Number of found assets

facets

Array

List of facets

tags

Array

List of tags

Example request

$ curl '{server hostname}/hub/api/v1/search' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "keywords" : "first",
  "sortCriteria" : "viewCount",
  "sortDirection" : "desc",
  "page" : 0,
  "limit" : 10,
  "showFacets" : true,
  "showAssets" : true,
  "showTags" : false,
  "selectedFacets" : {
    "3" : [ 8 ]
  },
  "selectedFields" : [ ],
  "selectedTags" : [ ]
}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 79

{
  "facets" : [ ],
  "assets" : [ ],
  "tags" : [ ],
  "assetCount" : 0
}

Suggest words

You can search for suggested words through the following entry point:

  • /hub/api/v1/suggest to search suggested words

Suggest words

A POST request is used to suggest words.

Request structure

Path Type Description

keywords

String

Suggest keywords

Response structure

Path Type Description

titles

Array

Suggested completed words from asset titles

tags

Array

Suggested completed words from asset tags

fuzzy.titles

Array

Other possibilities from asset titles based on fuzzy search

fuzzy.tags

Array

Other possibilities from asset tags based on fuzzy search

Example request

$ curl '{server hostname}/hub/api/v1/suggest' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "keywords" : "fi"
}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 111

{
  "titles" : [ "financial" ],
  "tags" : [ ],
  "fuzzy" : {
    "titles" : [ ],
    "tags" : [ ]
  }
}

Customize branding

You can customize the branding through the following entry point:

  • /hub/api/v1/branding to manage the branding

Retrieve the current branding

A GET request is used to retrieve the current branding

Response structure

Path Type Description

layout

Object

Layout for the branding

Example request

$ curl '{server hostname}/hub/api/v1/branding' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 115

{
  "layout" : {
    "id" : 2,
    "type" : "application",
    "assetType" : null,
    "content" : { }
  }
}

Customize title

A POST request is used to customize the title of the store

Request structure

Path Type Description

title

String

Title for the store

Response structure

Path Type Description

layout

Object

Layout for the branding

Example request

$ curl '{server hostname}/hub/api/v1/branding/title' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "title" : "My customized store title"
}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 165

{
  "layout" : {
    "id" : 2,
    "type" : "application",
    "assetType" : null,
    "content" : {
      "title" : "My customized store title"
    }
  }
}

Customize icon

A POST request is used to customize the icon of the store

Response structure

Path Type Description

layout

Object

Layout for the branding

Example request

$ curl '{server hostname}/hub/api/v1/branding/icon' -i -X POST -H 'Content-Type: multipart/form-data;charset=UTF-8' -F 'file=@icon;type=image/jpg'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 276

{
  "layout" : {
    "id" : 2,
    "type" : "application",
    "assetType" : null,
    "content" : {
      "title" : "My customized store title",
      "icon" : {
        "title" : "icon",
        "url" : "1922f656-6b1f-41f6-afd3-8896d79e95fc"
      }
    }
  }
}

Manage store maintenance

You can manage the maintenance of the store through the following entry point:

  • /hub/api/v1/maintenance to manage the store maintenance

Retrieve the current maintenance

A GET request is used to retrieve the current maintenance

Response structure

Path Type Description

[].id

Number

Identifier of the maintenance

[].user

Object

User who created the maintenance

[].status

String

Maintenance status (planned|active)

[].message

String

Maintenance message

[].creationDate

Number

Date of maintenance creation

[].startDate

Number

Start date of the maintenance

[].endDate

Number

End date of the maintenance

Example request

$ curl '{server hostname}/hub/api/v1/maintenance' -i -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 364

[ {
  "id" : 1,
  "user" : {
    "id" : 1,
    "corpId" : "I000000",
    "firstName" : "John",
    "lastName" : "Dev",
    "avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
  },
  "status" : "planned",
  "message" : "We plan a new maintenance",
  "creationDate" : 1493902672211,
  "startDate" : 61449400800000,
  "endDate" : 61450351200000
} ]

Create a maintenance

A POST request is used to create a maintenance

Request structure

Path Type Description

status

String

Maintenance status (planned|active)

startDate

Number

Start date of the maintenance

endDate

Number

End date of the maintenance

message

String

Maintenance message

Response structure

Path Type Description

id

Number

Identifier of the maintenance

user

Object

User who created the maintenance

status

String

Maintenance status (planned|active)

message

String

Maintenance message

creationDate

Number

Date of maintenance creation

startDate

Number

Start date of the maintenance

endDate

Number

End date of the maintenance

Example request

$ curl '{server hostname}/hub/api/v1/maintenance' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "message" : "We plan a new maintenance",
  "startDate" : 61449400800000,
  "endDate" : 61450351200000,
  "status" : "planned"
}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 360

{
  "id" : 1,
  "user" : {
    "id" : 1,
    "corpId" : "I000000",
    "firstName" : "John",
    "lastName" : "Dev",
    "avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
  },
  "status" : "planned",
  "message" : "We plan a new maintenance",
  "creationDate" : 1493902672211,
  "startDate" : 61449400800000,
  "endDate" : 61450351200000
}

Update a maintenance

A POST request is used to update a maintenance

Request structure

Path Type Description

status

String

Maintenance status (planned|active)

startDate

Number

Start date of the maintenance

endDate

Number

End date of the maintenance

message

String

Maintenance message

Response structure

Path Type Description

id

Number

Identifier of the maintenance

user

Object

User who created the maintenance

status

String

Maintenance status (planned|active)

message

String

Maintenance message

creationDate

Number

Date of maintenance creation

startDate

Number

Start date of the maintenance

endDate

Number

End date of the maintenance

Example request

$ curl '{server hostname}/hub/api/v1/maintenance/1' -i -X POST -H 'Accept: application/json' -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "message" : "We activate the maintenance",
  "startDate" : 61449573600000,
  "endDate" : 61450524000000,
  "status" : "active"
}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 361

{
  "id" : 1,
  "user" : {
    "id" : 1,
    "corpId" : "I000000",
    "firstName" : "John",
    "lastName" : "Dev",
    "avatar" : "https://avatars.wdf.sap.corp/avatar/unknown"
  },
  "status" : "active",
  "message" : "We activate the maintenance",
  "creationDate" : 1493902672211,
  "startDate" : 61449573600000,
  "endDate" : 61450524000000
}

Delete a maintenance

A DELETE request is used to delete a maintenance.

Path parameters

Table 4. /hub/api/v1/maintenance/{maintenanceId}
Parameter Description

maintenanceId

Identifier of the maintenance to be deleted

Response structure

Path Type Description

id

Number

Identifier of the deleted maintenance

Example request

$ curl '{server hostname}/hub/api/v1/maintenance/1' -i -X DELETE -H 'Content-Type: application/json;charset=UTF-8'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 16

{
  "id" : 1
}