Api doc


SDK's


Api Modules

messaging.message

Retrieve/Delete/Send individual messages.



Supported Methods:

GET
Params
  • token (Required): valid token
  • id (Required): integer


CREATE
Params
  • token (Required): valid token
  • subject (Required): varchar
  • message (Required): varchar
  • to (Required): integer


DELETE
Params
  • token (Required): valid token
  • id (Required): integer


UPDATE
Params
  • token (Required): valid token
  • id (Required): integer
  • read: enum (1, 0)


Documentation

GET
Retrieves a specific message by id.
Level 5 is required

--

Parameters:

  1. "id": required //Message id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"messaging.message",
  3. "method":"GET",
  4. "request":{
  5. "id":"1928"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"1928",
  5. "from":{
  6. "id":"3334",
  7. "name":"Alan Ford"
  8. },
  9. "to":{
  10. "id":"3334",
  11. "name":"Alan Ford"
  12. },
  13. "type":"1",
  14. "replyto":"0",
  15. "date_sent":"1339601203",
  16. "date_read":"0",
  17. "subject":"test",
  18. "message":"test",
  19. "message_formatted":"test",
  20. "date_sent_formatted":{
  21. "id":1141,
  22. "timestamp":1339545600,
  23. "month":6,
  24. "day":12,
  25. "year":2012,
  26. "week":24,
  27. "dayid":3,
  28. "weekday":"Tue",
  29. "mname":"Jun",
  30. "formatted":"Jun 12, 2012"
  31. },
  32. "date_read_formatted":[
  33.  
  34. ]
  35. },
  36. "token":"xxxxxxx"
  37. }

---

CREATE
Creates new message.
Level 5 is required

--

Parameters:

  1. "subject": required //Message subject (varchar)
  2. "message": required //Message body (varchar)
  3. "to": required //Recivers id (integer)
  4. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"messaging.message",
  3. "method":"CREATE",
  4. "request":{
  5. "subject":"subject",
  6. "message":"body",
  7. "to":"31256"
  8. }
  9. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"1929",
  5. "from":{
  6. "id":"3334",
  7. "name":"Alan Ford"
  8. },
  9. "to":{
  10. "id":"31256",
  11. "name":"Bob Rock"
  12. },
  13. "type":"1",
  14. "replyto":"0",
  15. "date_sent":"1339601203",
  16. "date_read":"0",
  17. "subject":"subject",
  18. "message":"body",
  19. "message_formatted":"test",
  20. "date_sent_formatted":{
  21. "id":1141,
  22. "timestamp":1339545600,
  23. "month":6,
  24. "day":12,
  25. "year":2012,
  26. "week":24,
  27. "dayid":3,
  28. "weekday":"Tue",
  29. "mname":"Jun",
  30. "formatted":"Jun 12, 2012"
  31. },
  32. "date_read_formatted":[
  33.  
  34. ]
  35. },
  36. "token":"xxxxxxx"
  37. }

---

UPDATE
Updates message.
Level 5 is required

--

Parameters:

  1. "id": required //Message id (integer)
  2. "read": accepted //Is message readed (enum[0,1])
  3. /* 0: Message is not read
  4.   * 1: Message is read */
  5. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"messaging.message",
  3. "method":"UPDATE",
  4. "request":{
  5. "id":"1929",
  6. "read":"1"
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"1929",
  5. "from":{
  6. "id":"3334",
  7. "name":"Alan Ford"
  8. },
  9. "to":{
  10. "id":"31256",
  11. "name":"Bob Rock"
  12. },
  13. "type":"1",
  14. "replyto":"0",
  15. "date_sent":"1339601203",
  16. "date_read":"0",
  17. "subject":"new subject",
  18. "message":"new body",
  19. "message_formatted":"test",
  20. "date_sent_formatted":{
  21. "id":1141,
  22. "timestamp":1339545600,
  23. "month":6,
  24. "day":12,
  25. "year":2012,
  26. "week":24,
  27. "dayid":3,
  28. "weekday":"Tue",
  29. "mname":"Jun",
  30. "formatted":"Jun 12, 2012"
  31. },
  32. "date_read_formatted":{
  33. "id":1141,
  34. "timestamp":1359500400,
  35. "month":1,
  36. "day":30,
  37. "year":2013,
  38. "week":5,
  39. "dayid":4,
  40. "weekday":"Wed",
  41. "mname":"Jan",
  42. "formatted":"Jan 30, 2013"
  43. }
  44. },
  45. "token":"xxxxxxx"
  46. }

---

DELETE
Deletes message.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "id": required //Message id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"messaging.message",
  3. "method":"DELETE",
  4. "request":{
  5. "id":"132"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":"",
  4. "token":"xxxxxxx"
  5. }