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. An API consumer applies when you are using the OAuth 1.0a for authorization and authentication. For more information, see Chapter 2 "Authorization and Authentication."
The Cisco WebEx Social API Consumer resource operations let you manage API consumers. Use of these operations require Cisco WebEx Social Administrator privileges.
Table 13-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
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—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 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-14 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
Response
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>
<consumerKey>198hj39870phj</consumerKey>
<consumerSecret>39ajke9qte9517</consumerSecret>
<createDate>0</createDate>
<description>Cisco WebEx Social Mobile App</description>
<modifiedDate>0</modifiedDate>
<resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
JSON Example
Request
GET http://webexsocialserver/api/quad/rest/management/apiconsumers/1210020
Response
Content-Type: application/json
"consumerKey": "198hj39870phj",
"consumerSecret": "39ajke9qte9517",
"description": "Cisco WebEx Social Mobile App",
"resource": "http://quad.cisco.com/schema/1.0/apiconsumer",
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—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 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-14 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
Response
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>
<consumerKey>198hj39870phj</consumerKey>
<consumerSecret>39ajke9qte9517</consumerSecret>
<createDate>0</createDate>
<description>Cisco WebEx Social Mobile App</description>
<modifiedDate>0</modifiedDate>
<resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<callbackUrl>http://callbackurl</callbackUrl>
<consumerKey>239487jk098zpo34</consumerKey>
<consumerSecret>1j73he992jlk</consumerSecret>
<createDate>0</createDate>
<description>Cisco WebEx Social CIUS App</description>
<modifiedDate>0</modifiedDate>
<resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
JSON Example
Request
GET http://webexsocialserver/api/quad/rest/management/apiconsumers/@all
Response
Content-Type: application/json
"consumerKey": "198hj39870phj",
"consumerSecret": "39ajke9qte9517",
"description": "Cisco WebEx Social Mobile App",
"resource": "http://quad.cisco.com/schema/1.0/apiconsumer",
"consumerKey": "239487jk098zpo34",
"consumerSecret": "39ajke9qte9517",
"description": "Cisco WebEx Social CIUS App",
"resource": "http://quad.cisco.com/schema/1.0/apiconsumer",
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—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 80.
Request Payload
The request payload includes fields from the Consumer resource (Table 3-14 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
Content-Type:application/xml
<callbackUrl>http://callbackurl</callbackUrl>
<description>Cisco WebEx Social Mobile App</description>
<modifiedDate>1316741399291</modifiedDate>
<name>Cisco WebEx Social Mobile App</name>
Response
<?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>
<callbackUrl>http://callbackurl</callbackUrl>
<consumerKey>198hj39870phj</consumerKey>
<consumerSecret>39ajke9qte9517</consumerSecret>
<createDate>1316742080410</createDate>
<description>Cisco WebEx Social Mobile App</description>
<modifiedDate>1316742080410</modifiedDate>
<resource>http://quad.cisco.com/schema/1.0/apiconsumer</resource>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
JSON Example
Request
POST http://webexsocialserver/api/quad/rest/management/apiconsumers
Content-Type:application/json
"description": "Cisco WebEx Social Mobile App",
"name": "Cisco WebEx Social Mobile App",
"callbackUrl": "http://callbackurl"
Response
"callbackUrl": "http://callbackurl",
"consumerKey": "198hj39870phj",
"consumerSecret": "39ajke9qte9517",
"createDate": 1316741399291,
"description": "Cisco WebEx Social Mobile App",
"modifiedDate": 1316741399291,
"resource": "http://quad.cisco.com/schema/1.0/apiconsumer",
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—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 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-14 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/1210020
Content-Type:application/xml
<callbackUrl>http://callbackurl</callbackUrl>
<description>Cisco WebEx Social Mobile App</description>
<modifiedDate>1316741399291</modifiedDate>
<name>Cisco WebEx Social Mobile App</name>
Response
Status Code: 204 No Content
JSON Example
Request
PUT http://webexsocialserver/api/quad/rest/management/apiconsumers/1210020
Content-Type:application/json
"callbackUrl": "http://callbackurl",
"description": "Cisco WebEx Social Mobile App",
"name": "Cisco WebEx Social Mobile App",
Response
Status Code: 204 No Content