Update Service Component
Added by IBM contributorRajmeet S Bal | Edited by Claudia R Elbourn on June 9, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

This operation update an existing service component. This operation checks for the existence of the Service Component whose Id is specified in the URI. If it exists then it changes modification date and updates the Service Component Entity.

The API caller must have either the "CustomerAdministrator","CSR","CSRManager" or "AppDeveloper" role to run the API.


Table 1. API details

Method
Resource address
Input representation
PUT
/resource/servicecomponent/<id>
A JavaScript™ Object Notation (JSON) entry that represents the service component to be updated.

 

 

URL parameters


Provide the following parameter.

Table 2. Parameters

Parameter
Required
Description
id
Yes
The internal ID of the service component.


 

Creating the payload


To create the payload, you must first retrieve the most current service component that you intend to update and make changes in it

OAuth 1.0a is supported and currently the OAuth 1.0a Credentials are generated by default. The OAuth 1.0a Credentials include the Consumer key and the Consumer secret.

User can make a simple call like below to update an existing service component's DisplayName or Description.

URI

resource/servicecomponent/

The service component resource is being manipulated

HTTP Method

PUT

This is a update operation so PUT is used

Operation Header

n/a

 

HTTP Request Body

{

"ServiceComponent": {

"Description": "bsstest description",

"DisplayName": "bsstest",

"Version": 5,

"Id": 23

}

}

Need to specify the following info as input:

 

- DisplayName (up to 50 char, cannot be duplicate in the same company)

- Description (not required, up to 1000 char)

-Version(required the resource current version)

- Id (the entity id to specify which service component to update)

HTTP Response Body

 

Note: You can use the Get Service component List method again to obtain the updated values.

If user want to use both OAuth 1.0a and OAuth 2.0, he/she can make a call like below to update an existing service component with OAuth 2.0 support. This will create OAuth 2.0 credentials for the service component. The OAuth 2.0 Credentials include the Client id and the Client secret.

If the service component already supports OAuth 2.0, then using the call below will just update the web app callback url and will not create OAuth 2.0 credentials again.

URI

resource/servicecomponent/

The service component resource is being manipulated

HTTP Method

PUT

This is a update operation so PUT is used

Operation Header

n/a

 

HTTP Request Body

{

"ServiceComponent": {

"Description": "bsstest description",

"DisplayName": "bsstest",

"Version": 5,

"Id": 23,

"ServiceComponentAttributeSet":[
{
"LongValue": 1,
"BooleanValue":true,
"StringValue":"",
"Name":"oauth2_web_server_flow_supported",
"DisplayPrecedence":0,
"DisplayName":"oauth2_web_server_flow_supported",

"Version": 5,
"Type":"BOOLEAN",
},
{
"LongValue": 1,
"BooleanValue":false,
"StringValue":"https://www.example.com/oauth2/callback",
"Name":"webapp_callback_url",
"DisplayPrecedence":0,
"DisplayName":"webapp_callback_url",

"Version": 5,
"Type":"STRING",
}
]

}

}

Need to specify the following info as input:

 

- DisplayName (up to 50 char, cannot be duplicate in the same company)

- Description (not required, up to 1000 char)

-Version(required the resource current version)

- specify "oauth2_web_server_flow_supported" ServiceComponentAttribute as type "Boolean" and value "true"

- specify "webapp_callback_url" ServiceComponentAttribute as type "String" with value which the user want Lotuslive want to redirect to after be granted access. The callback url must be started with "https".

HTTP Response Body

 

Note: You can use the Get Service component List method again to obtain the updated values.

Error Codes:

 

Error code

 

Error message

Reason for Error message

INPUT_FORMAT_ERROR (400)

Enter value for ServiceComponent DisplayName.

Field cannot be null or empty.

 

DisplayName exceeds maximum length of 50 characters.

Exceeding the maximum length for the field in database.

 

Description exceeds maximum length of 1000 characters.

Exceeding the maximum length for the field in database.

  Servicecomponent with the same displayName = ${displayName} already exists. Service component displayname must be unique in the same company.

DATA_NOT_FOUND (404)

Service component not found. Please input correct service component ID.

Invalid Service component ID

FORBIDDEN

(403)

Forbidden

User is not authorized to perform this operation.

For a list of common HTTP status codes that are returned for API calls, see HTTP status codes.


Output


If the update is successful, new service component's id is returned.

Parent topic: Service Component Services