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
- API Documentation Portal
- IO Docs Definition
- Mashery API Documentation
- Mashery 3.0 API Guide
- Mashery 2.0 API Guide
- OAuth Supporting Methods
- Examples
- JSON RPC
- Authentication
- API Objects
- Fetching Objects
- Query Language
- Creating Objects
- Updating Objects
- Validating Fields
- Deleting Objects
- Applications
- General Object Methods
- Members
- Packages
- Plans
- Package Keys
- Keys
- Developer Classes
- Services
- Roles
- Mashery 2.0 Reporting API Guide
- Event Trigger API
- Differences between Roles and Portal Access Groups
- Managing a Portal Access Group Using Mashery V2 or V3 API
- Mashery Reporting Event Post API Guide
- Tips and Tricks
- Your Portal
- API Traffic Manager
- I/O Docs WSDL requirements