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

This operation add a new Company App as a Service Component and produces OAuth credentials for this new Company App, in the BSS system, as a single call.

The API caller must have "CustomerAdministrator","CSR","CSRManager" or"AppDeveloper" roles to run the API:


Table 1. API details
Method
Resource address
Input representation
POST
resource/servicecomponent
A JavaScript™ Object Notation (JSON) entry that represents a subscriber.
 

Input attributes


The input payload must be a well formatted JSON object with the attributes that are listed in the Input attributes table.

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 add a new Company App as well as generate the OAuth 1.0a Credentials:

URI

resource/servicecomponent

The service component resource is being manipulated

HTTP Method

POST

This is a create operation so POST is used

Operation Header

n/a

 

HTTP Request Body

{

"ServiceComponent": {

"Description": "bsstest description",

"DisplayName": "bsstest"

}

}

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)

HTTP Response Body

{

"Long": 48

}

The id of the newly created App / Service component is returned on its successful creation.

OAuth 2.0 is optional based on user's choice whether to support OAuth 2.0 or not. If user want to use both OAuth 1.0a and OAuth 2.0, he/she can make a call like below to add a new Company App which can support both OAuth 1.0a and the Web server flow of OAuth 2.0. The OAuth 2.0 Credentials include the Client id and the Client secret.

 

URI

resource/servicecomponent

The service component resource is being manipulated

HTTP Method

POST

This is a create operation so POST is used

Operation Header

n/a

 

HTTP Request Body

{

"ServiceComponent": {

"Description": "bsstest description",

"DisplayName": "bsstest",

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

"DisplayPrecedence":0,
"DisplayName":"webapp_callback_url",
"Type":"STRING",
}
]

}

}

 

note: "Name":"oauth2_web_server_flow_supported" will change to "Name":"basic_auth_flow_supported" for basic authentication apps

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)

- 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

{

"Long": 48

}

The id of the newly created App / Service component is returned on its successful creation.

 

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.

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.

Parent topic: Service Component Services