Skip to content
Kai Böhrnsen edited this page May 20, 2016 · 1 revision

Parameters

  • Action (required)
    • Takes one of these values: get, image, suggest, report

Action Specific Parameters

Get

All parameters available for offentligkonst.se API can be used with the get action.
These parameters are documented at offentligkonst.se API constraints.

Restrictions

Som restrictions implemented in the API to the available parameters are the following:

  • Predefined parameters can not be modified
  • format parameter must be either json or geojson
Predefined Parameters

These parameters are set inside the API before requesting data from offentligkonst.se API and can not be modified.

  • json: compact
  • is_inside: false
  • is_removed: false
  • has_same: false

Report

All parameters available for offentligkonst.se API can be used with the get action.
These parameters are documented at offentligkonst.se API constraints.

Error Codes

General Error Codes

These codes can be returned throughout the entire API

  • 400 - Bad Request (Used for missing required parameters or bad values provided)
  • 405 - Method Not Allowed (Reguest method is not allowed for requested resource)
  • 601 - Action Not Recognised (Action parameter provided is not supported)
  • 602 - Format Not Recognised (Format parameter provided is not supported)

Action Specific Error Codes

Get

Returns error codes from offentligkonst.se API.
These are documented at offentligkonst.se API error codes.

Report

  • 521 - MYSQL Connect Error (Database connection failed)
    • Returns error code and message
// Example response HTTP status code: 521
{
  error:{
    {
      "code": "2002",
      "info": "Can't connect to local MySQL server through socket (mysql.sock) (38)"
    }
  }
}
  • 522 - MYSQL Query Error (The Query could not be performed)
    • Returns error message {error: //error message returned from MYSQL}

Suggest

  • 620 - MediaWiki API Login Failed (Login to MediaWiki API with configured account failed)
    • This can occur in the following conditions:
      • Bad login token retrieved from the MediaWiki API
      • Wrong login data provided in the config file
    • Reason is returned in an error message
  • 621 - MediaWiki API Login Blocked (Account has been blocked)

Image/Suggest

  • 610 - MediaWiki API Error (Request to MediaWiki API from within this API returned an error)
    • Returns error message returned from the MediaWiki API
// Example response HTTP status code: 610
{
  error:{
    {
      "code": "unknown_action",
      "info": "Unrecognized value for parameter 'action': blah",
      "*": "See https://en.wikipedia.org/w/api.php for API usage"
    }
  }
}
  • 611 - MediaWiki API Warnings (Request to MediaWiki API from within this API returned warnings)
    • Returns warning messages returned from the MediaWiki API
// Example response HTTP status code: 611
{
  warnings:{
    "main": {
      "*": "Unrecognized parameter: 'rmparam'"
    },
    "query": {
      "*": "Unrecognized value for parameter 'list': raremodule"
    }
  }
}

Report/Suggest

  • 520 - Missing Config File (Needed config files are not available)
    • A local.php or server.php file must be present in api/config
    • see template.php for right format

Output Formats

All outputs are formatted in JSON.

Clone this wiki locally