Toss Specification (2011 Draft) : Level 0


register (1)

summary Register a communication Pipe to send/receive messages.
verb GET
candidate level Level 1
promoted NO
returns registered Pipe id as a string

parameters

scope scope of the communication
topic subject of communication. This parameter is required when type parameter is receive, multicast_duplex, or unicast_duplex
type type of communication pipe. Possible values are multicast_send, unicast_send, receive, multicast_duplex, and unicast_duplex
alias (optional) Name alias of sender/receiver.
realm (optional) security realm. This parameter indicates user of the pipe has to be from specified realm. More security controls are provided by register (2)

remarks
  • In JavaScript sample codes you may see an additional "callback" parameter being used. The parameter is required for JSONP requests only. It's not part of the API.
  • TODO: incorporate selected security modes such as secret/application key and/or claim-based security
examples

1. to register a multicast pipe to send messages
http(s)://[host]/register?scope=myscope&type=multicast_send
2. to register a receiving pipe
http(s)://[host]/register?scope=myscope&type=receive&topic=chat

send

summary Send a message to a sending pipe.
verb GET/POST
candidate level Level 1
promoted NO
returns "OK" with 200 response if successful. Otherwise corresponding state codes (such as 400 and 500) are returned.

parameters

package Package to be sent. Package is a UTF-8 encoded string.
pipe the pipe to be used to send data.
topic subject of communication.

remarks
  • The send request can either use GET verb or POST verb.

1. to send a simple text message
http(s)://[host]/send?pipe=[pipe]topic=mytopic&package=hello

Last edited Nov 11, 2011 at 9:50 PM by Haishi, version 9

Comments

No comments yet.