Chatea API

Simple Chat as example for https://adw0rd.github.io/chatea

JSON Documentation

Method: addRoom

https://json.smappi.org/adw0rd/chatea/addRoom?roomname=<string>

Create new room

addRoom("room1")
  // => true

Live Example

Request:
https://json.smappi.org/adw0rd/chatea/addRoom?roomname=example
Response:
Internal Server Error

Method: getRooms

https://json.smappi.org/adw0rd/chatea/getRooms

Get list of rooms

addRoom("room1")
  addRoom("room2")
  getRooms()
  // => ['room1', 'room2']

Live Example

Request:
https://json.smappi.org/adw0rd/chatea/getRooms
Response:
Internal Server Error

Method: getRoom

https://json.smappi.org/adw0rd/chatea/getRoom?roomid=<number>

Get ROOM with items

(function () { let i = getRoom(1); delete i.created_at; return i; })()
  // => {'items': [], 'name': 'room1'}

Live Example

Request:
https://json.smappi.org/adw0rd/chatea/getRoom?roomid=42
Response:
Internal Server Error

Method: addItem

https://json.smappi.org/adw0rd/chatea/addItem?roomid=<number>&nickname=<string>&message=<string>

Add item to room

(function () { let i = addItem(1, "adw0rd", "test"); delete i.created_at; return i; })()
  // => {name: "adw0rd", "message": "test"}
  addItem(2, "adw0rd", "test")
  // => false

Live Example

Request:
https://json.smappi.org/adw0rd/chatea/addItem?roomid=42&nickname=example&message=example
Response:
Internal Server Error

XML Documentation

Method: addRoom

https://xml.smappi.org/adw0rd/chatea/addRoom?roomname=<string>

Create new room

addRoom("room1")
  // => true

Live Example

Request:
https://xml.smappi.org/adw0rd/chatea/addRoom?roomname=example
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
  <id>3</id>
  <name>example</name>
  <created_at>Mon May 21 2018 17:01:45 GMT+0000 (UTC)</created_at>
</root>

Method: getRooms

https://xml.smappi.org/adw0rd/chatea/getRooms

Get list of rooms

addRoom("room1")
  addRoom("room2")
  getRooms()
  // => ['room1', 'room2']

Live Example

Request:
https://xml.smappi.org/adw0rd/chatea/getRooms
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
  <item>
    <id>1</id>
    <name>room1</name>
  </item>
  <item>
    <id>2</id>
    <name>room2</name>
  </item>
  <item>
    <id>3</id>
    <name>example</name>
  </item>
</root>

Method: getRoom

https://xml.smappi.org/adw0rd/chatea/getRoom?roomid=<number>

Get ROOM with items

(function () { let i = getRoom(1); delete i.created_at; return i; })()
  // => {'items': [], 'name': 'room1'}

Live Example

Request:
https://xml.smappi.org/adw0rd/chatea/getRoom?roomid=42
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root/>

Method: addItem

https://xml.smappi.org/adw0rd/chatea/addItem?roomid=<number>&nickname=<string>&message=<string>

Add item to room

(function () { let i = addItem(1, "adw0rd", "test"); delete i.created_at; return i; })()
  // => {name: "adw0rd", "message": "test"}
  addItem(2, "adw0rd", "test")
  // => false

Live Example

Request:
https://xml.smappi.org/adw0rd/chatea/addItem?roomid=42&nickname=example&message=example
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>false</root>

SOAP Documentation (coming soon)

WSDL-Scheme here...

Method: addRoom

https://soap.smappi.org/adw0rd/chatea/addRoom?roomname=<string>

Create new room

addRoom("room1")
  // => true

Live Example

Request:
https://soap.smappi.org/adw0rd/chatea/addRoom?roomname=example
Response:
Internal Server Error

Method: getRooms

https://soap.smappi.org/adw0rd/chatea/getRooms

Get list of rooms

addRoom("room1")
  addRoom("room2")
  getRooms()
  // => ['room1', 'room2']

Live Example

Request:
https://soap.smappi.org/adw0rd/chatea/getRooms
Response:
{"error":{"code":"1501","message":"Format \"soap\" is not supported!"}}

Method: getRoom

https://soap.smappi.org/adw0rd/chatea/getRoom?roomid=<number>

Get ROOM with items

(function () { let i = getRoom(1); delete i.created_at; return i; })()
  // => {'items': [], 'name': 'room1'}

Live Example

Request:
https://soap.smappi.org/adw0rd/chatea/getRoom?roomid=42
Response:
{"error":{"code":"1501","message":"Format \"soap\" is not supported!"}}

Method: addItem

https://soap.smappi.org/adw0rd/chatea/addItem?roomid=<number>&nickname=<string>&message=<string>

Add item to room

(function () { let i = addItem(1, "adw0rd", "test"); delete i.created_at; return i; })()
  // => {name: "adw0rd", "message": "test"}
  addItem(2, "adw0rd", "test")
  // => false

Live Example

Request:
https://soap.smappi.org/adw0rd/chatea/addItem?roomid=42&nickname=example&message=example
Response:
{"error":{"code":"1501","message":"Format \"soap\" is not supported!"}}
[A]
author

Versions

  • master