Cisco WebEx Social API Reference Guide, Release 3.0
API Consumer Resource Operations
Downloads: This chapterpdf (PDF - 156.0KB) The complete bookPDF (PDF - 14.42MB) | Feedback

API Consumer Resource Operations

Table Of Contents

API Consumer Resource Operations

Get Information about an API Consumer

Get Information about All API Consumers

Add an API Consumer

Update the Designated API Consumer


API Consumer Resource Operations


A Cisco WebEx Social API consumer is an application that enables the API to access Cisco WebEx Social resources and entities on behalf of a Cisco WebEx Social user.

The Cisco WebEx Social API Consumer resource operations let you manage API consumers. Use of these operations require Cisco WebEx Social Administrator privileges.

Table 11-1 provides a summary of the API Consumer resource operations. Each operation is described in detail in the section that is listed.

These sections provide this information:

Purpose—Brief explanation of the operation

Availability—Cisco WebEx Social releases that support the operation

Request—HTTP method and URI for the operation

Request Payload—Description of the request payload, if the operation requires one

Response—Description of the expected response when the operation executes

Examples—Sample requests and responses for the operation

Table 11-1 API Consumer Resource Operations Summary 

Operation and Reference
Purpose

Get Information about an API Consumer

Retrieves information about the designated API consumer

Get Information about All API Consumers

Retrieves information about each API consumer that has registered with Cisco WebEx Social

Add an API Consumer

Creates a profile in Cisco WebEx Social for an API consumer

Update the Designated API Consumer

Updates the designated API consumer


Get Information about an API Consumer

Purpose

Retrieves information about the designated API consumer.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

GET

http://server[:port_number]/api/quad/rest/management/apiconsumers
/
consumer_id[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

consumer_id

Identifier of the API consumer to retrieve. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the Consumer resource to include in a response (Table 3-11 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter does not apply

The startIndex query parameter does not apply

The count query parameter does not apply

The meta query parameter does not apply


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with a response payload that can include one Consumer resource (the "Consumer Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

GET http://webexsocialserver/api/quad/rest/management/apiconsumers/1210020
Accept:application/xml

Response

HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:response xmlns:ns2="http://quad.cisco.com/ns/1.0/xml">
  <statusCode>200</statusCode>
  <startIndex>0</startIndex>
  <itemsPerPage>1</itemsPerPage>
  <totalResults>0</totalResults>
  <filtered>false</filtered>
  <sorted>false</sorted>
  <entry>
    <apiconsumer>
      <accessPermission/>
      <author>110189</author>
      <callbackUrl/>
      <companyId>0</companyId>
      <consumerKey>198hj39870phj</consumerKey>
      <consumerSecret>39ajke9qte9517</consumerSecret>
      <createDate>0</createDate>
      <description>Cisco WebEx Social Mobile App</description>
      <id>1210020</id>
      <modifiedDate>0</modifiedDate>
      <name>Auth Test 1</name>
      <resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
      <state>active</state>
      <type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </apiconsumer>
  </entry>
</ns2:response>

JSON Example

Request

GET http://webexsocialserver/api/quad/rest/management/apiconsumers/1210020
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 200, 
    "startIndex": 0, 
    "itemsPerPage": 1, 
    "totalResults": 0,
    "filtered": false, 
    "sorted": false, 
    "entry": [
        {
            "data": {
                "accessPermission": "", 
                "author": "110189", 
                "callbackUrl": "", 
                "companyId": 0, 
                "consumerKey": "198hj39870phj", 
                "consumerSecret": "39ajke9qte9517", 
                "createDate": 0, 
                "description": "Cisco WebEx Social Mobile App", 
                "id": 1210020, 
                "modifiedDate": 0, 
                "name": "Auth Test 1", 
                "resource": "http://quad.cisco.com/schema/1.0/apiconsumer", 
                "state": "active", 
                "type": null
            }
        }
    ], 
    "serverMessages": null
}

Get Information about All API Consumers

Purpose

Retrieves information about each API consumer that has registered with Cisco WebEx Social.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

GET

http://server[:port_number]/api/quad/rest/management/apiconsumers/@all
[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the Consumer resource to include in a response (Table 3-11 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter is not supported for sorting resources in a response

The startIndex query parameter is supported for paginating return results

The count query parameter is supported for designating the maximum number of items in the return results

The meta query parameter does not apply


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with a response payload that can include one or more Consumer resources (the "Consumer Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

GET http://webexsocialserver/api/quad/rest/management/apiconsumers/@all
Accept:application/xml

Response

HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:response xmlns:ns2="http://quad.cisco.com/ns/1.0/xml">
  <statusCode>200</statusCode>
  <startIndex>0</startIndex>
  <itemsPerPage>2</itemsPerPage>
  <totalResults>2</totalResults>
  <filtered>false</filtered>
  <sorted>false</sorted>
  <entry>
    <apiconsumer>
      <accessPermission/>
      <author>110189</author>
      <callbackUrl/>
      <companyId>0</companyId>
      <consumerKey>198hj39870phj</consumerKey>
      <consumerSecret>39ajke9qte9517</consumerSecret>
      <createDate>0</createDate>
      <description>Cisco WebEx Social Mobile App</description>
      <id>1210020</id>
      <modifiedDate>0</modifiedDate>
      <name>Auth Test 1</name>
      <resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
      <state>active</state>
      <type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </apiconsumer>
  </entry>
  <entry>
    <apiconsumer>
      <accessPermission/>
      <author>110189</author>
      <callbackUrl>http://callbackurl</callbackUrl>
      <companyId>0</companyId>
      <consumerKey>239487jk098zpo34</consumerKey>
      <consumerSecret>1j73he992jlk</consumerSecret>
      <createDate>0</createDate>
      <description>Cisco WebEx Social CIUS App</description>
      <id>1210021</id>
      <modifiedDate>0</modifiedDate>
      <name>Buth Test 2</name>
      <resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
      <state>active</state>
      <type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </apiconsumer>
  </entry>
</ns2:response>

JSON Example

Request

GET http://webexsocialserver/api/quad/rest/management/apiconsumers/@all
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 200,
    "startIndex": 0, 
    "itemsPerPage": 1, 
    "totalResults": 1, 
    "filtered": false, 
    "sorted": false, 
    "entry": [
        {
            "data": {
                "accessPermission": "", 
                "author": "110189", 
                "callbackUrl": "", 
                "companyId": 0, 
                "consumerKey": "198hj39870phj", 
                "consumerSecret": "39ajke9qte9517", 
                "createDate": 0, 
                "description": "Cisco WebEx Social Mobile App", 
                "id": 1210020, 
                "modifiedDate": 0, 
                "name": "Auth Test 1", 
                "resource": "http://quad.cisco.com/schema/1.0/apiconsumer", 
                "state": "active", 
                "type": null
            }
        },
       {
            "data": {
                "accessPermission": "", 
                "author": "110189", 
                "callbackUrl": "", 
                "companyId": 0, 
                "consumerKey": "239487jk098zpo34", 
                "consumerSecret": "39ajke9qte9517", 
                "createDate": 0, 
                "description": "Cisco WebEx Social CIUS App", 
                "id": 1210020, 
                "modifiedDate": 0, 
                "name": "Auth Test 1", 
                "resource": "http://quad.cisco.com/schema/1.0/apiconsumer", 
                "state": "active", 
                "type": null
            }
        }
    ], 
    "serverMessages": null
}

Add an API Consumer

Purpose

Creates a profile in Cisco WebEx Social for an API consumer.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

POST

http://server[:port_number]/api/quad/rest/management/apiconsumers


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.


Request Payload

The request payload includes fields from the Consumer resource (Table 3-11 describes these fields):

Required Fields
Optional Fields

name

callbackUrl
description


Response

Standard response (see the "API Responses" section) with a response payload that can include one Consumer resource (the "Consumer Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

POST http://webexsocialserver/api/quad/rest/management/apiconsumers
Accept:application/xml
Content-Type:application/xml
 
   
<apiconsumer>
  <callbackUrl>http://callbackurl</callbackUrl>
  <description>Cisco WebEx Social Mobile App</description>
  <modifiedDate>1316741399291</modifiedDate>
  <name>Cisco WebEx Social Mobile App</name>
</apiconsumer>

Response

Status Code: 201 Created
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:response xmlns:ns2="http://quad.cisco.com/ns/1.0/xml">
  <statusCode>200</statusCode>
  <startIndex>0</startIndex>
  <itemsPerPage>1</itemsPerPage>
  <totalResults>0</totalResults>
  <filtered>false</filtered>
  <sorted>false</sorted>
  <entry>
    <apiconsumer>
      <accessPermission/>
      <author>110189</author>
      <callbackUrl>http://callbackurl</callbackUrl>
      <companyId>0</companyId>
      <consumerKey>198hj39870phj</consumerKey>
      <consumerSecret>39ajke9qte9517</consumerSecret>
      <createDate>1316742080410</createDate>
      <description>Cisco WebEx Social Mobile App</description>
      <id>1210022</id>
      <modifiedDate>1316742080410</modifiedDate>
      <name>Auth Test</name>
      <resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
      <state>active</state>
      <type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </apiconsumer>
  </entry>
</ns2:response>

JSON Example

Request

POST http://webexsocialserver/api/quad/rest/management/apiconsumers
Accept:application/json
Content-Type:application/json
 
   
{
    "description": "Cisco WebEx Social Mobile App", 
    "name": "Cisco WebEx Social Mobile App", 
    "callbackUrl": "http://callbackurl"
}

Response

Status Code: 201 Created
{
    "statusCode": 200, 
    "startIndex": 0, 
    "itemsPerPage": 1, 
    "totalResults": 0,
    "filtered": false, 
    "sorted": false, 
    "entry": [
        {
            "data": {
                "accessPermission": "", 
                "author": "110189", 
                "callbackUrl": "http://callbackurl", 
                "companyId": 0, 
                "consumerKey": "198hj39870phj", 
                "consumerSecret": "39ajke9qte9517", 
                "createDate": 1316741399291, 
                "description": "Cisco WebEx Social Mobile App", 
                "id": 1210021, 
                "modifiedDate": 1316741399291, 
                "name": "Auth Test", 
                "resource": "http://quad.cisco.com/schema/1.0/apiconsumer", 
                "state": "active", 
                "type": null
            }
        }
    ], 
    "serverMessages": null
}

Update the Designated API Consumer

Purpose

Updates the designated API consumer.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

PUT

http://server[:port_number]/api/quad/rest/management/apiconsumers
/
consumer_id


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

consumer_id

Identifier of the API consumer to update. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.


Request Payload

The request payload includes fields from the Consumer resource (Table 3-11 describes these fields):

Required Fields
Optional Fields

callbackURL
description
name
state
type


Response

Standard response (see the "API Responses" section) with an HTTP header only.

XML Example

Request

PUT http://webexsocialserver/api/quad/rest/management/apiconsumers/1
Accept:application/xml
Content-Type:application/xml
 
   
<apiconsumer>
  <callbackUrl>http://callbackurl</callbackUrl>
  <description>Cisco WebEx Social Mobile App</description>
  <modifiedDate>1316741399291</modifiedDate>
  <name>Cisco WebEx Social Mobile App</name>
  <type>mobile</type>
  <state>inactive</state>
</apiconsumer>

Response

Status Code: 204 No Content

JSON Example

Request

PUT http://webexsocialserver/api/quad/rest/management/apiconsumers/1
Accept:application/json
Content-Type:application/json
 
   
{
    "callbackUrl": "http://callbackurl", 
    "description": "Cisco WebEx Social Mobile App", 
    "name": "Cisco WebEx Social Mobile App", 
    "state": "active", 
    "type": "desktop"
}

Response

Status Code: 204 No Content