xwg.query
Description
Query for xWG information. The all purpose method to access anything about xWG.
Params
- token
- string
-
Access token.
- filterOptions
- struct
-
Filtering options. At least one filtering option must be set.
- forceShowUnofficial
- bool
- optional
- default: true
-
By default, each category (tag) has specified whether it should display unofficial xWGs in the listing. This allows to display only official catalogue for categories that official catalogue contains, and unofficial xWGs in categories which are only on this site. But you can force to show unofficial items regardless specified category filtering.
You should almost always set this to true in all cases where you don't want to display catalogue pages. For example if you want to search for xWGs or display user's collection, you must set this to true to be able to show entire result set.
- query
- string
- optional
-
Search query (anything that can be entered into the search box on the website) You can use the query to search xWGs by name.
- xwgIds
- array
- optional
-
Search for xWGs with given IDs only.
- xwgId
- int
-
ID of xWG.
- collected
- bool
- optional
-
Only show xWGs that authorized user has collected. If true, list items that authorized has collected. If false, list items that authorized user doesn't have collected. Do not specify this filter if you don't care.
- offered
- bool
- optional
-
Only show xWGs that authorized user offers. Same logic as for collected apply here.
- wanted
- bool
- optional
-
Only show xWGs that authorized user wants. Same logic as for collected apply here.
- notWanted
- bool
- optional
-
Only show xWGs that authorized user does not want. Same logic as for collected apply here.
- collectedBy
- string
- optional
-
Only retrieve items collected by certain user. Specify that user's name.
- offeredBy
- string
- optional
-
Only retrieve items offered by certain user. Specify that user's name.
- wantedBy
- string
- optional
-
Only retrieve items wanted by certain user. Specify that user's name.
- notWantedBy
- string
- optional
-
Only retrieve items not wanted by certain user. Specify that user's name.
- tags
- array
- optional
-
Only retrieve items that has specified tags set. All tags must be set for certain item to include that item in the result set.
- displayOptions
- struct
-
Options that affects what is returned.
- sort
- array
- optional
-
Sort by specified columns
- limit
- int
- optional
- default: 100
-
Maximum number of returned items. You can request at most 100 items at one method call.
- offset
- int
- optional
- default: 0
-
How many items to skip from start of result.
- show
- array
-
List of columns to return. Always request only columns that you want, to reduce traffic needed to transfer data over network. In large result sets, this method can return in a lot of data.
- columnName
- string
- enum
-
Value Description id
xWG ID
name
xWG name
version
xWG version
cat_no
Catalogue number
note
xWG comment
tags
Retrieve list of tags. Includes both tags in categories and also user's defined tags.
collected
Whether the item is collected by authorized user. Only loads the collected flag. To load entire collection, use
collection
column name.offered
Whether the item is offered by authorized user.
wanted
Whether the item is wanted by authorized user.
notwanted
Whether the item is not wanted by authorized user.
collection
Include full collection information for authorized user.
offer
Offer additional information (pieces and comment).
Response
- response
- struct
-
- status
- int
- enum
-
Status code
Value Description 200
OK
400
Bad params
403
User has hidden profile, you cannot retrieve items based on that user's information.
404
One of items specified by
filterOptions.xwgIds
was not found. Or user specified infilterOptions.collectedBy
,filterOptions.offeredBy
,filterOptions.wantedBy
orfilterOptions
.notwantedBy
does not exists.500
Server error
- statusMessage
- string
-
Status code description
- items
- array
-
List of xWGs matching specified filtering criteria.
- item
- struct
-
One xWG
- id
- int
- optional
-
xWG ID. Only if
displayOptions.show
containsid
. - name
- string
- optional
-
xWG name. Only if
displayOptions.show
containsname
. - version
- string
- optional
-
xWG version. Only if
displayOptions.show
containsversion
. - cat_no
- string
- optional
- null
-
Catalogue number. Only if
displayOptions.show
containscat_no
. NULL if xWG is not from official catalogue. - comment
- string
- optional
-
xWG comment. Only if
displayOptions.show
containsnote
. - flags
- struct
- optional
-
xWG flags. Only if
displayOptions.show
contains one ofcollected
,offered
,wanted
,notwanted
.- collected
- bool
- optional
-
Is the xWG collected by authorized user? Only if
displayOptions.show
containscollected
. - offered
- bool
- optional
-
Is the xWG offered by authorized user? Only if
displayOptions.show
containsoffered
. - wanted
- bool
- optional
-
Is the xWG wanted by authorized user? Only if
displayOptions.show
containswanted
. - notwanted
- bool
- optional
-
Is the xWG not wanted by authorized user? Only if
displayOptions.show
containsnotwanted
.
- tags
- array
-
List of tags. Only if
displayOptions.show
containstags
. - collection
- array
-
Collection information. Only if
displayOptions.show
containscollection
.
- totalCount
- int
-
Total number of items not affected by limit and offset.
Call example
xwg.query("elit", {"forceShowUnofficial": false, "query": "pariatur", "xwgIds": [934291601], "collected": false, "offered": false, "wanted": true, "notWanted": false, "collectedBy": "incididunt ut labore", "offeredBy": "sed", "wantedBy": "in", "notWantedBy": "consectetur adipiscing elit", "tags": [{"name": "duis", "category": "qui officia"}]}, {"sort": [{"columnName": "version", "direction": "ASC"}], "limit": 760528803, "offset": 1339104550, "show": ["notwanted"]})