Cisco WebEx Social API Reference Guide, Release 3.1
API Client Resource Operations
Downloads: This chapterpdf (PDF - 108.0KB) The complete bookPDF (PDF - 16.07MB) | Feedback

API Client Resource Operations

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

1 If you are using the OAuth 2.0 authorization code flow, specify authorization_code for the flow field. If you are using the OAuth 2.0 implicit flow, specify implicit for the flow field.


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
Accept:application/xml
Content-Type:application/xml
<apiclient>
<redirectUri>http://client.url.com/redirecturl</redirectUri>
<title>test client</title>
<type>confidential</type>
<flow>authorization_code</flow>
</apiclient>

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>
  <sorted>false</sorted>
  <entry>
    <data>
      <clientId>bbe60273f56b6835e4f845a537caa5d1443a92d1</clientId>
      <clientSecret>d84f6cd3512307a88a652008517490292e4a3ea3</clientSecret>
      <companyId>10195</companyId>
      <createDate />
      <flow>authorization code</flow>
      <iconUrl></iconUrl>
      <id>0</id>
      <modifiedDate />
      <redirectUri>http://client.url.com/redirecturl</redirectUri>
      <resource>http://client.url.com/redirecturl</resource>
      <title>Client Title</title>
      <type>confidential</type>
      <userId>10258</userId>
      <userName>Pat Kim</userName>
    </data>
  </entry>
  <serverMessages />

Request—Implicit Flow

POST http:///webexsocialserver/api/quad/rest/management/apiclients
Accept:application/xml
Content-Type: application/xml
<apiclient>
   <redirectUri>http://yoursite.com</redirectUri>
   <title>My Implicit Client</title>
   <type>public</type>
   <flow>implicit</flow>
 </apiclient>

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>
   <sorted>false</sorted>
   <entry>
     <apiclient>
       <clientId>3740c147af8205cdabbe2840b1223823d941e540</clientId>
       <clientSecret>445f8e0895a45442f33849354f6f2521152ddcb1</clientSecret>
       <companyId>10196</companyId>
       <flow>implicit</flow>
       <iconUrl></iconUrl>
       <id>0</id>
       <redirectUri>http://yoursite.com</redirectUri>
       <resource>http://quad.cisco.com/schema/1.0/base</resource>
       <title>My Implicit Client</title>
       <type>public</type>
       <userId>10258</userId>
       <userName>Pat Kim</userName>
     </apiclient>
   </entry>
 </ns2:response>

JSON Example

Request—Authorization Code Flow

POST http:///webexsocialserver/api/quad/rest/management/apiclients
Accept:application/json
Content-Type:application/json
{"redirectUri":"http://client.url.com/redirecturl",
  "title":"Client Title",
  "type":"confidential",
  "flow":"authorization_code"
}

Response—Authorization Code Flow

{
   "statusCode":200,
   "startIndex":0,
   "itemsPerPage":1,
   "totalResults":0,
   "filtered":false,
   "sorted":false,
   "entry":[
      {
         "data":{
            "clientId":"bbe60273f56b6835e4f845a537caa5d1443a92d1",
            "clientSecret":"d84f6cd3512307a88a652008517490292e4a3ea3",
            "companyId":10195,
            "createDate":null,
            "flow":"authorization code",
            "iconUrl":"",
            "id":0,
            "modifiedDate":null,
            "redirectUri":"http://client.url.com/redirecturl",
            "resource":"http://client.url.com/redirecturl",
            "title":"Client Title",
            "type":"confidential",
            "userId":10258,
            "userName":"Pat Kim"
         }
      }
   ],
   "serverMessages":null
}

Request—Implicit Flow

POST http:///webexsocialserver/api/quad/rest/management/apiclients
Accept: application/json
Content-Type:application/json
{"title":"Your Implicit Client",
  "type":"public",
  "flow":"implicit",
  "redirect_uri":"http://yoursite.com"
}

Response—Implicit Flow

{
   "statusCode": 200,
   "startIndex": 0,
  "itemsPerPage": 1,
   "totalResults": 1,
   "filtered": false,
   "sorted": false,
   "entry": [
     {
       "data": {
         "clientId": "1d26f84c735390df0c8b890f6b74f07b04433adb",
         "clientSecret": "8a7c775303e4558d73944da8f0ebd94b014d1df0",
         "companyId": 10196,
         "createDate": null,
         "flow": "implicit",
         "iconUrl": "",
         "id": 0,
         "modifiedDate": null,
         "redirectUri": "",
         "resource": "http://quad.cisco.com/schema/1.0/base",
         "title": "Your Implicit Client",
         "type": "public",
         "userId": 10258,
         "userName": "Pat Kim"
       }
     }
   ],
   "serverMessages": null
 }