Esri's Geotrigger Service is replacing Geoloqi! Learn More | FAQ

batch/run

Contents

URL

https://api.geoloqi.com/1/batch/run

Description

This API method allows you to run a batch of requests without making individual calls to the API. This should allow your scripts to run considerably faster since there will only be one request made to the API and the individual calls will be made internally.

Supported Request Methods

POST

Sample Input

The input to this method must be a JSON object, which also means you must set the "Content-type" header of the request to "application/json".

The input object must include the access token you wish to use to make the following requests. You specify the relative path of the API method to run, everything after the "1/" of the API methods. You can optionally specify a body to POST to the method, and if you'd like, you can also specify an array of HTTP headers.

{
   "access_token":"ba1-128a8e75c1359c5d651120ca760ba8cce20bdadb",
   "batch": [
      {
         "relative_url":"place/create",
         "headers": [
            "Timezone: 2011-03-31T12:27:00-0700;;America/Los_Angeles"
         ],
         "body": {
            "layer_id":"10B",
            "name":"1250459724",
            "radius":500,
            "latitude":45.530768,
            "longitude":-122.655583,
            "date_from":1301572800,
            "date_to":1301583600,
            "extra": {
               "description":"CEO Group Coaching Program at Doubletree Hotel & Executive Meeting Center Portland - Lloyd Center at 3/31 8:00am",
               "url":"http://loqi.me/28W"
            }
         }
      },
      {
         "relative_url":"place/create",
         "body": {
            "layer_id":"10B",
            "name":"1250459876",
            "radius":500,
            "latitude":45.511624,
            "longitude":-122.683808,
            "date_from":1301576400,
            "date_to":1301587200,
            "extra": {
               "description":"PDX Open Source GIS Unconference Day One at Portland State University (PSU) - Smith Memorial Center at 3/31 9:00am",
               "url":"http://loqi.me/28X"
            }
         }
      }
   ]
}

Sample Response

The response will be an array of objects, each object will contain the HTTP code that the server returned, an array of HTTP headers, the response body, and the request time of each method call.

{
   "result":[
      {
         "code":409,
         "headers":[
            {
               "name":"Date",
               "value":"Thu, 31 Mar 2011 18:56:37 GMT"
            },
            {
               "name":"Cache-Control",
               "value":"no-store"
            },
            {
               "name":"Location",
               "value":"https://api.geoloqi.com/1/place/info/3nE"
            },
            {
               "name":"Content-Length",
               "value":"18"
            },
            {
               "name":"Content-Type",
               "value":"application/json"
            }
         ],
         "body":{
            "place_id":"3nE"
         },
         "time_ms":123.861
      },
      {
         "code":409,
         "headers":[
            {
               "name":"Date",
               "value":"Thu, 31 Mar 2011 18:56:37 GMT"
            },
            {
               "name":"Cache-Control",
               "value":"no-store"
            },
            {
               "name":"Location",
               "value":"https://api.geoloqi.com/1/place/info/3nF"
            },
            {
               "name":"Content-Length",
               "value":"18"
            },
            {
               "name":"Content-Type",
               "value":"application/json"
            }
         ],
         "body":{
            "place_id":"3nF"
         },
         "time_ms":132.969
      }
   ]
}