Table Of Contents
API Client Resource Operations
Register an API Client
API Client Resource Operations
A Cisco WebEx Social API client 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 client applies when you are using OAuth 2 for authorization and authentication. For more information, see Chapter 2 "Authorization and Authentication."
Table 14-1 provides a summary of the API Client resource operation. This operation is described in detail in the section that is listed. The section provides 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 14-1 Configuration Operation Summary
Operation and Reference
|
Purpose
|
Register an API Client
|
Creates a profile in Cisco WebEx Social for an API client
|
Register an API Client
Purpose
Creates a profile in Cisco WebEx Social for an API client.
Availability
Cisco WebEx Social 3.1 and later.
Request
HTTP Method
|
URI
|
POST
|
http://server[:port_number]http://server[:port_number]/api/quad/rest/ management/apiclients
|
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 Client resource (Table 3-5 describes these fields:
Required Fields
|
Optional Fields
|
title type flow1
|
redirectUri
|
Response
Standard response (see the "API Responses" section) with a response payload that can include one Client resource (the "Client Resource" section describes this resource). XML and JSON formats are supported.
XML Example
Request—Authorization Code Flow
POST http:///webexsocialserver/api/quad/rest/management/apiclients
Content-Type:application/xml
<redirectUri>http://client.url.com/redirecturl</redirectUri>
<title>test client</title>
<type>confidential</type>
<flow>authorization_code</flow>
Response—Authorization Code Flow
<?xml version="1.0" encoding="UTF-8" ?>
<statusCode>200</statusCode>
<startIndex>0</startIndex>
<itemsPerPage>1</itemsPerPage>
<totalResults>0</totalResults>
<filtered>false</filtered>
<clientId>bbe60273f56b6835e4f845a537caa5d1443a92d1</clientId>
<clientSecret>d84f6cd3512307a88a652008517490292e4a3ea3</clientSecret>
<companyId>10195</companyId>
<flow>authorization code</flow>
<redirectUri>http://client.url.com/redirecturl</redirectUri>
<resource>http://client.url.com/redirecturl</resource>
<title>Client Title</title>
<type>confidential</type>
<userName>Pat Kim</userName>
Request—Implicit Flow
POST http:///webexsocialserver/api/quad/rest/management/apiclients
Content-Type: application/xml
<redirectUri>http://yoursite.com</redirectUri>
<title>My Implicit Client</title>
Response—Implicit Flow
<?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>1</totalResults>
<filtered>false</filtered>
<clientId>3740c147af8205cdabbe2840b1223823d941e540</clientId>
<clientSecret>445f8e0895a45442f33849354f6f2521152ddcb1</clientSecret>
<companyId>10196</companyId>
<redirectUri>http://yoursite.com</redirectUri>
<resource>http://quad.cisco.com/schema/1.0/base</resource>
<title>My Implicit Client</title>
<userName>Pat Kim</userName>
JSON Example
Request—Authorization Code Flow
POST http:///webexsocialserver/api/quad/rest/management/apiclients
Content-Type:application/json
{"redirectUri":"http://client.url.com/redirecturl",
"flow":"authorization_code"
Response—Authorization Code Flow
"clientId":"bbe60273f56b6835e4f845a537caa5d1443a92d1",
"clientSecret":"d84f6cd3512307a88a652008517490292e4a3ea3",
"flow":"authorization code",
"redirectUri":"http://client.url.com/redirecturl",
"resource":"http://client.url.com/redirecturl",
Request—Implicit Flow
POST http:///webexsocialserver/api/quad/rest/management/apiclients
Content-Type:application/json
{"title":"Your Implicit Client",
"redirect_uri":"http://yoursite.com"
Response—Implicit Flow
"clientId": "1d26f84c735390df0c8b890f6b74f07b04433adb",
"clientSecret": "8a7c775303e4558d73944da8f0ebd94b014d1df0",
"resource": "http://quad.cisco.com/schema/1.0/base",
"title": "Your Implicit Client",