Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-3261

ACS Messages API documentation missing

    Details

    • Type: Improvement
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Environment:

      Appcelerator doc website

      Description

      The new ACS documentation is missing the Messages API: http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.Cloud

      Old documentation:
      Sends a message with an optional subject to one or more specified users. The thread_id of the first outgoing message is its own id. Replies to the first or subsequent messages in the thread will all use the id of the first message as their thread_id. The output of this API method is the copy of the message saved to the sender's sent mail.

      URL: POST http://api.cocoafish.com/v1/messages/create.json

      Required Parameters:
      to_ids one or more Ids of users to send the message to
      body the body of the message

      Optional Parameters:
      subject message subject
      custom_data_fields user-defined data.

      Example cURL request:
      $ curl -b cookies.txt -c cookies.txt -F "to_ids=4d71445b6f70951043000006,4d7184f06f70951043000012" -F "subject=Sunday Afternoon" -F "body=Howabout going to the Academy of Sciences?" http://api.cocoafish.com/v1/messages/create.json?key=<YOUR APP API KEY>
      Example JSON response:
      {
      "meta":

      { "status":"ok", "code":200, "method_name":"createMessage" }

      ,
      "response": {
      "messages": [
      {
      "id":"4d85418dd0afbe013e000027",
      "thread_id":"4d85418dd0afbe013e000025",
      "status":"sent",
      "subject":"Sunday Afternoon",
      "body":"Howabout going to the Academy of Sciences?",
      "created_at":"2011-03-19T23:51:41+0000",
      "updated_at":"2011-03-19T23:51:41+0000",
      "from":

      { "id":"4d7e6493d0afbe01d8000001", "first_name":"Michael", "last_name":"Goff", "created_at":"2011-03-14T18:55:15+0000", "updated_at":"2011-03-19T05:05:29+0000" }

      ,
      "to": [

      { "id":"4d854129d0afbe013e000022", "first_name":"Wei", "last_name":"Kong", "created_at":"2011-03-19T23:50:01+0000", "updated_at":"2011-03-19T23:50:01+0000" }

      ,

      { "id":"4d85415ad0afbe013e000023", "first_name":"George", "last_name":"Dy", "created_at":"2011-03-19T23:50:50+0000", "updated_at":"2011-03-19T23:50:50+0000" }

      ]
      }
      ]
      }

      Example Javascript call:
      var sdk = new Cocoafish('<YOUR APP API KEY>'); // app key
      var data =

      { to_ids = '4d71445b6f70951043000006,4d7184f06f70951043000012', body = 'new message!' }

      ;
      sdk.sendRequest('messages/create.json', 'POST', data, false, callback);
      SDK Callback:
      function callback(data) {
      if(data) {
      if(data.meta)) {
      var meta = data.meta;
      if(meta.status == 'ok' && meta.code == 200 && meta.method_name == 'createMessage')

      { var messages = data.response.messages; ... }

      }
      }
      }

      Sharry

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain (Inactive)
              Reporter:
              molinto Sharry
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration