object.query

Description

This call can perform ad-hoc queries on supported objects.

Note that unlike other methods in this api, the results of this method call may be cached and may be slightly out of date.  The number of total_pages may be cached independently of the results returned.  Use the fetch method to retreive the most up to date version of any object.

Parameters

query

A string representing an object query.

Response

A result set object is returned representing the results of the query.  The result set always follows a paginated format with a maximum of 100 pimary records returned.

total_items

This is a count of the total number of records available that match the specified query.

items_per_page

This is the number of items per page that was used to calculate pagination.

total_pages

This is the total number of available pages, given the items_per_page.

current_page

This is the current page number based on the items_per_page and page number passed in the query specification.

items

This is a array of the objects requested in the query specification.  The array will be empty if no objects matched the query specification.

Examples

A Sample JSON-RPC Object Query Request

{
    "method": "object.query",
    "params": ["SELECT name FROM roles"],
    "id": 1
}

The JSON-RPC Response

{
    "result": {
        "total_items": "9",
        "total_pages": 1,
        "items_per_page": 25,
        "current_page": 1,
        "items": [
            {
                "name": "Administrator"
            },
            {
                "name": "API Beta Tester"
            },
            {
                "name": "API Manager"
            },
            {
                "name": "Community Manager"
            },
            {
                "name": "Content Manager"
            },
            {
                "name": "Everyone"
            },
            {
                "name": "Member"
            },
            {
                "name": "Portal Manager"
            },
            {
                "name": "Program Manager"
            }
        ]
    },
    "error": null,
    "id": 1
}

Permissions Required

The user who owns the key used to authenticate the member.fetch call must be a member of one of the following roles

  • Administrator
  • Program Manager
  • Community Manager

See authentication.

Errors

In addition to the standard json-rpc errors and authentication errors, member.fetch may also return these errors:

HTTP Status Code JSON-RPC Code Error Message Description
400
3000
Invalid Query

Docs Navigation