Skip to content

Rename an Item

Definition

POST /apis/v2/{SERVICE_ID}/item/rename

Description

Change the name of a specific service’s item.

Details:

This resource cannot be used to change the item’s application key: the application key is not changed, even if the user who renames the item has selected a different application publisher profile.

Permissions

The user needs to have the permissions:

SERVICE_ID=read && SERVICE_ID=edit

To rename an item, the user needs to have the associated Application Publisher Profile.

The user needs to have the permissions to read the original item AND the item with the new name.

Parameters

The body parameter is a JSON object containing the old and the new identifiers.

The new name must validate the rules of the service’s item’s name.

Example:

{
    "oldId": {
        "appKey": "",
        "name": "Well-Network-Plant-Approver"
    },
    "newId": {
        "appKey": "",
        "name": "Well-Network-Plant-Approver (Renamed)"
    }
}

Response

HTTP code Reason
200 Success
400 Invalid parameter count or content
403 Unauthorized
404 Not found
500 Unexpected exception

When the query is successful, the HTTP response is a 200 OK and returns the facade of the renamed item.

{
  "appKey": "block",
  "name": "Well-Network-Plant-Approver (Renamed)",
  "description": "Table Well-Network-Plant-Approver",
  "calculatedContentMode": "EDITABLE",
  "appInfo": "",
  "lastModifiedBy": "roxane.mace@amalto.com",
  "lastModifiedDate": 1520873165788,
  "revisionId": "c42bcfe17f53fe6bbcc2ad0982c731ad"
}

If the request parameter is null, the HTTP response is a 400 Invalid parameter:

{
  "status": 400,
  "code": 400,
  "message": "Unexpected error renaming the item in the configuration!",
  "link": null,
  "developerMessage": "Invalid parameter count or content: the ids cannot be null.",
  "conflictInformation": null
}

If the user does not have the right permissions, the HTTP Response will be a 403 Unauthorized:

{
  "status": 403,
  "code": 403,
  "message": "Unexpected error renaming the item in the configuration! Access to the item 'block.Well-Network-Plant-Approver' is not authorized. You need to have the permission 'read'.",
  "link": null,
  "developerMessage": "Unauthorized: access to the item 'block.Well-Network-Plant-Approver' is not authorized, permission 'read' is missing.",
  "conflictInformation": null
}

If the original item is not found, it will return a 404 Not found:

{
  "status": 404,
  "code": 404,
  "message": "Unexpected error updating the item in the configuration! Item 'block.Well-Network-Plant-Approver' is not found.",
  "link": null,
  "developerMessage": "Not found: the item 'block.Well-Network-Plant-Approver' is not found.",
  "conflictInformation": null
}