Wiki

Clone wiki

ma3route-api-documentation / News

Home

#!https
GET /news

To access listed news send a GET request to https://www.ma3route.com/findit-api/v2/json/news

Parameters

Note: If no other parameter other than the defaults parameters is supplied, the server returns a list of 500 news items.

  • id a long value. The server returns a json object of the news item whose id equals the value supplied.

  • limit a long value. This is the maximum list size to be returned. The default limit is 500.

  • lastread_id is a long value. This is the news item id of the last news item the client saw/read. This is basically the offset for other api implementations.

  • searchkey a string value. If provided, the server returns a list of news items whose title/description contain the search key. lastread_id and limit are checked if provided.

Server Response

The response is a JSON object with "meta" and "data" properties.

data is a json object/array representing a news item or a list of news items respectively.

Sample Response

#!json

{
   "meta":{
      "listsize":1
   },
   "data":[
      {
         "id":210,
         "date":"Apr 30, 2015 9:05:45 PM",
         "isactive":true,
         "title":"Chinese motorists dance their way through traffic jam",
         "description":"Funkiness broke out on a congested highway outside Kunming City, Yunnan Province, on 22 April. As a car accident brought traffic to a standstill, thousands of motorists found themselves stranded on the asphalt with no escape in sight.\r\n\r\nSo they did all anyone could do at a time like that: get their groove on.",
         "shortdescription":"Funkiness broke out on a congested highway outside Kunming City, Yunnan Province, on 22 April. As a car accident brought traffic to a standstill, thousands of motorists found themselves stranded on...",
         "viewscount":0,
         "url":"http://en.rocketnews24.com/2015/04/28/chinese-motorists-dance-their-way-through-traffic-jam/",
         "photourl":"http://www.ma3route.com/images-uploadapi/f81b56f57bcfa649736d6f8548b83294.jpg"
      }
   ]
}
#!https
POST /news
Use the user accessToken to perform this operation.

To post a news item send a POST request to https://www.ma3route.com/findit-api/v2/json/news

The request body should be a json object with it's fields as in:

#!json
{
    "title":"?", 
    "description":"?",     
    "mediaurl":"?",
    "url":"?", 
    "email":"?",     
}
* title a string value. Mandatory. * description a string value. Mandatory. * mediaurl a fully qualified url string for the news item headline image. It MUST be 110x110. Mandatory. * url a fully qualified url string for the news item redirect site. Mandatory. * email a string value. A valid email address for the user posting the news item. e.g info@ma3route.com. Mandatory.

Once you post, you will receive a response from the server, which is a JSON object that will indicate if you successfully posted the ad or if an error occurred. For now, we are not pointing to the exact cause of the error, this will be done in future enhancements.

Server response

#!json
{
   "meta":{      
   },
   "data":{
      "success":true,
      "message":"You successfully posted an update"
   }
}
OR

#!json
{
   "meta":{     
   },
   "data":{
      "success":false,
      "message":"Error! Check that you have all mandatory properties in the object. Avoid empty strings!"
   }
}

Updated