POST tp/bulk/message/send

Sends a message from a contact to a list of indoona resources: a resource can be a user chat or a group chat.
It is possible to send text, stickers, location, address book contacts and various types of media messages (see Message Send reference for specifications on all message formats). Returns the outcome of the operation as a json object: the response may contain recipients for which the sending contact is not authorized.

N.B: this API must be invoked using the application-level token (client credentials).

Resource URL

https://api.indoona.com/tp/bulk/message/send.json

Parameters

name description
contact_id unique identifier of the sender contact
resources space separated list of recipient resource ids
msg_type message type, can be "text", "sticker", "location", "picture", "movie", "sound" (audio file), "voice" (audio note), "file" (other than media)
no_push (optional) boolean value which specifies whether the message should not produce a push notification; default is 'false'

Custom parameters

name description
text message body as string, only for "text" message type
sticker_id sticker identifier as string, only for "sticker" message type
geo_description location description
geo_lat latitude as double precision floating point, only for "location" message type
geo_lon longitude as double precision floating point, only for "location" message type
vcard xml string representation of an address book contact according to the XSD schema above, only for "contact" message type
file file as binary data, only for "picture", "movie", "sound", "voice" or "file" message types (Warning: a POST multipart request is needed)

Examples

Text message


POST https://api.indoona.com/tp/bulk/message/send.json
Content-Type=application/x-www-form-urlencoded

contact_id=54&msg_type=text&text=Hello!&resources=1i7qr9t0dxc0kiw8u4fmzx69f%204g3bx1u2efa3gpo3q2hjkx22h&no_push=false

Response
{
	"accepted":true,
	"not_authorized":["1i7qr9t0dxc0kiw8u4fmzx69f"]
}

Sticker message


POST https://api.indoona.com/tp/bulk/message/send.json
Content-Type=application/x-www-form-urlencoded

contact_id=54&resources=1i7qr9t0dxc0kiw8u4fmzx69f%204g3bx1u2efa3gpo3q2hjkx22h&msg_type=sticker&sticker_id=tp-status_01.png&no_push=false

Response
{
	"accepted":true,
	"not_authorized":["1i7qr9t0dxc0kiw8u4fmzx69f"]
}

Location message


POST https://api.indoona.com/tp/bulk/message/send.json
Content-Type=application/x-www-form-urlencoded

contact_id=54&resources=1i7qr9t0dxc0kiw8u4fmzx69f%204g3bx1u2efa3gpo3q2hjkx22h&msg_type=location&geo_lat=9.2292391&geo_lon=9.07051&no_push=false

Response
{
	"accepted":true,
	"not_authorized":["1i7qr9t0dxc0kiw8u4fmzx69f"]
}

Address book contact message


POST https://api.indoona.com/tp/bulk/message/send.json
Content-Type=application/x-www-form-urlencoded

contact_id=54&resources=1i7qr9t0dxc0kiw8u4fmzx69f%204g3bx1u2efa3gpo3q2hjkx22h&msg_type=contact&vcard=%3Ccontact+xmlns%3D%27indoona%3Ax%3Acontact%27%3E%3Cname%3EJohn%3C%2Fname%3E%3Csurname%3EDoe%3C%2Fsurname%3E%3Cphone+type%3D%22home%22%3E%2B12223335566%3C%2Fphone%3E%3Cphone+type%3D%22work%22%3E%2B12223335567%3C%2Fphone%3E%3C%2Fcontact%3E

Response
{
	"accepted":true,
	"not_authorized":["1i7qr9t0dxc0kiw8u4fmzx69f"]
}

Media message (picture, movie, sound, voice, file)


POST https://api.indoona.com/tp/bulk/message/send.json
Content-Type=multipart/form-data

Parts:
contact_id=54
resources=1i7qr9t0dxc0kiw8u4fmzx69f%204g3bx1u2efa3gpo3q2hjkx22h
msg_type=picture	// or any other valid media message type
no_push=false
file = (file as binary data)	

Response
{
	"accepted":true,
	"not_authorized":["1i7qr9t0dxc0kiw8u4fmzx69f"]
}