API > Making the request

Calls to the SWL API are made using a method name, OAuth authentication information, and a collection of optional parameters. In order to make a successful call, the first two must be passed, with the parameters being optional based on the requested method.

A call to the SWL API would take the following format:

http://SITENAME/services/2.0/methodname?param1=val&param2=val2

The above is an example of of a GET request. Alternatively, the parameters can be sent via POST, in which the the parameters are passed in the HTTP POST to a URL in the following format:

http://SITENAME/services/2.0/methodname

Where 'SITENAME' would be the fully qualified URL for the site, e.g. www.smallworldlabs.com, and where 'methodname' would be a valid API method.

Passing authentication credentials

There are two options for passing in the OAuth parameters, as per the specification:

  • Preferably, the parameters will be encoded and included in an Authorization header as specified in the OAuth Specification in the Authorization Header section
  • The OAuth parameters can be encoded in the same method (GET or POST) as the rest of the parameters.

Limitations

By default, each site is limited to 50 API calls per minute per key. This is in order to keep our servers happy and sane!