0% found this document useful (0 votes)
8 views18 pages

Cafe REST API Documentation Guide

The document describes the REST API for a CAFE application. It provides documentation on resources, methods, parameters, request and response formats for making calls and interacting with conferences using the REST API.

Uploaded by

arteepu37022
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views18 pages

Cafe REST API Documentation Guide

The document describes the REST API for a CAFE application. It provides documentation on resources, methods, parameters, request and response formats for making calls and interacting with conferences using the REST API.

Uploaded by

arteepu37022
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CAFE REST API Documentation

[Link]

CAFE REST API Documentation


REST support has been provided so that users can access Cafe artifacts over http without having to write additional server side code. Resources [Link] [Link] //resources//calls [Link] //resources//calls//list [Link] //resources//calls//server [Link] //resources//calls//server//call/{callid} [Link] //resources//calls//server//createcall [Link] //resources//calls//client [Link] //resources//conferences [Link] //resources//conferences//list [Link] //resources//conferences//server [Link] //resources//conferences//server//conference /{conferenceid} [Link] //resources//conferences//server//createconference [Link] //resources//conferences//server//conference /{conferenceid}/add [Link] //resources//conferences//server//conference /{conferenceid}/add/{participantid} [Link] //resources//conferences//server//conference /{conferenceid}/remove [Link] //resources//conferences//server//conference /{conferenceid}/remove/{participantid} [Link] //resources//conferences//client Representations application/xml application/json Status Code 200 - application/xml (ns3:CafeRestMessage) Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml

1 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

application/json Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml application/json application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml application/json Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml application/json application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) Status Code 200 - application/xml (ns3:CafeRestMessage) application/xml application/json application/xml application/json application/xml application/json application/xml application/json application/xml application/json application/xml application/json

Resources
//resources
Communication resource is the entry point for all the dierent types of communications like Call , Conference Can be acessed using "/resource" context path. This resource is a JSR311 based rest resource.

Methods

//resources//calls
Calls REST resource that maps all the calls in the application. [Link]

Methods

2 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

//resources//calls//list
Methods
GET Used to retrieve all the calls that are in progress. [Link] /{contextroot}/resources/calls/list available response representations: application/xml application/json

//resources//calls//server
Call resource maps one call in the system. It can be used to create or modify a call or retrived information corresponding to a call. [Link]

Methods

//resources//calls//server//call/{callid}
resource-wide template parameters
parameter
callid

value
string

description
callid

Methods
GET Retrieves the current status of the call if the callid is valid and belongs to this application. [Link] /{server/client}/call/{callid} available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage) PUT Creates a call if the call id does not exist, or modies the call if it exists. [Link] /call/{callid}

request query parameters


parameter
from

value
string

description
caller

3 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

to

string

callee.

available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage) POST Creates a call if the call id does not exist, or modies the call if it exists. [Link] /call/{callid} acceptable request representations: application/xml application/json available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage) DELETE Ends a call. [Link] /client}/call/{callid}

response header parameters


parameter
Callid

value
String

description
The deleted call id.

available response representations: application/xml application/json

//resources//calls//server//createcall
Methods
POST Creates a call, used along with POST method. [Link] /{contextroot}/resources/calls/{server/client}/createcall acceptable request representations: application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage)

4 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

//resources//calls//client
Call resource maps one call in the system. It can be used to create or modify a call or retrived information corresponding to a call. [Link]

Methods

//resources//conferences
Conferences REST resource that maps all the conferences in the application. [Link] /client}

Methods

//resources//conferences//list
Methods
GET Used to retrieve all the calls that are in progress. [Link] /{contextroot}/resources/conferences/list available response representations: application/xml application/json

//resources//conferences//server
Conference resource maps one conference in the system. It can be used to create or modify a conference or retrived information corresponding to a conference. [Link] /client}/conference/{conferenceid}

Methods

//resources//conferences//server //conference/{conferenceid}
resource-wide template parameters

5 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

parameter
conferenceid

value
string

description
conference id

Methods
GET Retrieves the current status of the conference if the id is valid and belongs to this application. [Link] /conferences/{server/client}/conference/{conferenceid} available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage) PUT Creates a conference if the id does not exist, or modies the call if it exists. [Link] /client}/conference/{conferenceid} acceptable request representations: application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage) DELETE Ends a conference. [Link] /conferences/{server/client}/conference/{conferenceid}

response header parameters


parameter
Conference id

value
String

description
The deleted Conference id.

available response representations: application/xml application/json

//resources//conferences//server //createconference
Methods
POST Should be used to create a conference with a server generated conference id. The create with the PUT method should be used when

6 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

the client wants to supply the call id. acceptable request representations: application/xml (ns3:CafeRestMessage) application/json (ns3:CafeRestMessage) available response representations: Status Code 200 - application/xml (ns3:CafeRestMessage)

//resources//conferences//server //conference/{conferenceid}/add
resource-wide template parameters
parameter
conferenceid

value
string

description
conference id

Methods
POST Adds a participant from the conference. Should be POST and not PUT because we cannot gurantee idempotency with PUT. We could use PUT if we model Participant as a resource. acceptable request representations: application/xml application/json available response representations: application/xml application/json

//resources//conferences//server //conference/{conferenceid} /add/{participantid}


resource-wide template parameters
parameter
participantid conferenceid

value
string string

description

conference id

Methods
PUT

7 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

Adds a participant from the conference. Should be POST and not PUT because we cannot gurantee idempotency with PUT. We could use PUT if we model Participant as a resource. available response representations: application/xml application/json

//resources//conferences//server //conference/{conferenceid}/remove
resource-wide template parameters
parameter
conferenceid

value
string

description
conference id.

Methods
POST Removes a participant from the conference. acceptable request representations: application/xml application/json available response representations: application/xml application/json

//resources//conferences//server //conference/{conferenceid}/remove /{participantid}


resource-wide template parameters
parameter
participantid conferenceid

value
string string

description

conference id.

Methods
DELETE Removes a participant from the conference. available response representations:

8 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

application/xml application/json

//resources//conferences//client
Conference resource maps one conference in the system. It can be used to create or modify a conference or retrived information corresponding to a conference. [Link] /client}/conference/{conferenceid}

Methods

Representations
application/xml application/json Status Code 200 - application/xml (ns3:CafeRestMessage)
Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </to> <id>samplecallid</id> <status>INACTIVE</status> </call> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema

9 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

Source:

Status Code 200 - application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </to> <id>samplecallid</id> <status>INACTIVE</status> </call> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema
Source:

application/xml application/json Status Code 200 - application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name>

10 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<nickname>Bob</nickname> <status>ACTIVE</status> </to> <id>samplecallid</id> <status>INACTIVE</status> </call> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema
Source:

application/xml application/json application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestRequest> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </to> <id></id> <status></status> </call> </cafeRestRequest> </cafeRestMessage>

XML Schema
Source:

application/json (ns3:CafeRestMessage)
Example

11 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestRequest> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </to> <id></id> <status></status> </call> </cafeRestRequest> </cafeRestMessage>

XML Schema
Source:

Status Code 200 - application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <call> <from> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </from> <to> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </to> <id>samplecallid</id> <status>INACTIVE</status> </call> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema
Source:

application/xml
12 of 18 Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

application/json Status Code 200 - application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id>sampleconferenceid</id> <status>ACTIVE</status> </conference> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema
Source:

application/xml (ns3:CafeRestMessage)
Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname>

13 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id></id> <status></status> </conference> </cafeRestResponse> </cafeRestMessage>

XML Schema
Source:

application/json (ns3:CafeRestMessage)
Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id></id> <status></status> </conference> </cafeRestResponse> </cafeRestMessage>

XML Schema
Source:

Status Code 200 - application/xml (ns3:CafeRestMessage)


Example

14 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id>sampleconferenceid</id> <status>ACTIVE</status> </conference> </cafeRestResponse> </cafeRestMessage>

Status of the call after completion.

XML Schema
Source:

application/xml application/json application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant>

15 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id></id> <status></status> </conference> </cafeRestResponse> </cafeRestMessage>

XML Schema
Source:

application/json (ns3:CafeRestMessage)
Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse> <conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id></id> <status></status> </conference> </cafeRestResponse> </cafeRestMessage>

XML Schema
Source:

Status Code 200 - application/xml (ns3:CafeRestMessage)


Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cafeRestMessage xmlns="[Link] <cafeRestResponse>

16 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

<conference> <originator> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </originator> <participant> <name>alice@[Link]</name> <nickname>Alice</nickname> <status>ACTIVE</status> </participant> <participant> <name>bob@[Link]</name> <nickname>Bob</nickname> <status>ACTIVE</status> </participant> <id>sampleconferenceid</id> <status>ACTIVE</status> </conference> </cafeRestResponse> </cafeRestMessage>

XML Schema
Source:

application/xml application/json application/xml application/json application/xml application/json application/xml application/json application/xml

17 of 18

Wednesday 15 August 2012 07:51 AM

CAFE REST API Documentation

[Link]

application/json application/xml application/json

18 of 18

Wednesday 15 August 2012 07:51 AM

You might also like