Peer-to-Peer Communication API
Peer-to-Peer Communication API enables your management app to get end user’s usage. This document describes the following endpoints which Peer-to-Peer Communication API supports:
Method | Description |
---|---|
GET /sessions | Fetch information about sessions |
Note: The default encoding is UTF-8.
Date formats
Peer-to-Peer Communication API accepts dates formatted in the ISO-8601 standard in UTC (no local timezone offset).
YYYY-MM-DDTHH:MM:SSZ
GET /sessions
This API fetches and lists information about session created by your end users.
Request
curl --request GET 'https://api-turn.api.ricoh/v1/sessions?from=2016-09-01T00%3A00%3A00Z&to=2017-09-30T23%3A59%3A59Z' /
--header 'Authorization: Bearer <Access Token>'
URL Structure
https://api-turn.api.ricoh/v1/sessions
Headers
Header | Description |
---|---|
Authorization | Required. Authorization Header Set your Access Token as a Bearer token. |
Query Parameters
Field | Description |
---|---|
from | Required. The start time of the search target period. Limit search results to sessions whose end time exceeds this time. You can not specify a time after the time specified by ‘to’. |
to | Required. The end time of the search target period. Limit search results to sessions whose start time is less than this time. The upper limit is UTC time of the previous day 00:00:00. If a time that exceeds the upper limit value is specified, it is rounded to the upper limit. |
page | Optional. The page number. If an invalid value is specified, the default value of 1 is used. |
pageSize | Optional. The number of sessions per page. If an invalid value is specified, the default value of 10 is used. The maximum value is 100. |
Response
{
"from": "2017-05-30T13:02:05Z",
"to":"2017-06-30T13:02:05Z",
"sessions":[
{
"session_id":"6005c7de-939a-11e7-bb1c-0a481fa19f66_000000000000000001",
"started_at":"2017-09-20T05:55:54Z",
"closed_at":"2017-09-20T06:32:04Z",
"duration":37,
"sub":"user01",
"user_plan":"turn_free",
},
{
"session_id": "2246e734-939a-11e7-bcd8-06f44c5bd1f2_000000000000000002",
"started_at":"2017-09-20T05:55:54Z",
"closed_at":"2017-09-20T06:32:05Z",
"duration": 37,
"sub":"user02",
"user_plan":"turn_free",
}
],
"total":8,
"nextPage":"https://api-turn.api.ricoh/v1/sessions?page=2&pageSize=2&from=2016-09-01T00%3A00%3A00Z&to=2017-09-30T23%3A59%3A59Z"
}
Headers
Header | Description |
---|---|
Content-Type | application/json; charset=utf-8 |
Body
Field | Type | Description |
---|---|---|
from | string | The start time of the search target period. |
to | string | The end time of the search target period. |
sessions | array of objects(Session) | List of sessions. |
total | integer | Total number of search results. |
nextPage | string | The URL for requesting the next page and null if the next page does not exist. |
Object(Session)
Field | Type | Description |
---|---|---|
session_id | string | The session identifier. |
started_at | string | The session start time. |
closed_at | string | The session end time. ’-‘ will be returned instead of time, if the session was not closed. |
duration | integer | The whole session length (in minutes). It’s not limited to the specified period. It is 0 for sessions that have not ended on request. |
sub | string | The identifier of the sender. |
user_plan | string | The plan name for the session. |
Status Codes
Code | Reason |
---|---|
200 | OK |
400 | Bad Request. |
401 | Unauthorized. Invalid or expired Access Token. |
405 | Method not allowed. |
500 | Internal server error. |