Get Methods
Retrieve all items
This method allows you to retrieve all items – currently the first 10 records are displayed (with a link to the next 10)
Parameters:
item_type |
An item type (e.g. documents, themes, countries) | Example values
|
e.g. /hub/get_all/{item_type}
Retrieve single item
This method allows you to retrieve a single item
Parameters:
item_id |
An ID of single item | Example values
|
e.g. /hub/get/documents/{item_id}
Search Methods
Search
This method allows you to search content across all fields. Note the search is not case-sensitive, although some other queries are case-sensitive. Results are returned in relevance rank sort order.
Parameters:
search_query |
A search term | Example values
|
e.g. /hub/search/documents/?q=governance
Field Search
This method allows you to search content within a specific field.
Parameters:
field |
A specific field to search on | Example values
|
search_query |
A search term | Example values
|
e.g. /hub/search/documents/?{field}={search_query}
Wildcard searching
This method allows you to search content using a substitute character or wildcard. Note that you can use * in your query, but not as the first character.
Parameters:
field |
A specific field to search on | Example values
|
search_query |
A search term | Example values
but not *ca |
e.g. /hub/search/documents/?{field}={search_query}
Search by date
This method allows you to search by date.
Parameters:
date_type |
The date field to be queried on. | Example values
|
date |
The date | Example values
|
e.g. /hub/search/documents/?q=UNDP&{date_type}={date}
Combining query fields
Query fields may be combined, so for example a free text search for ‘malaria’ could be combined with a country search for ‘Angola’. Note that query fields are always ANDed together as they use the query string.
Parameters:
search_query_1 |
A search term for the first field to be searched. | Example values
|
field |
The field to be queried on | Example values
|
search_query_2 |
A search term for the second field to be searched | Example values
|
e.g. /hub/search/documents/?q={search_query_1}&{field}={search_query_2}
Combining query terms
Within each query field you can combine terms using either AND or OR using the & and | characters respectively. These characters must be URL encoded.
In this case & becomes %26 and | becomes %7C.
Parameters:
field |
A field to be queried on. | Example values
|
search_query_1 |
A search term for the first field to be searched. | Example values
|
operator |
Operator – url encoded values for AND / & (%26) or OR / | (%7C), | Example values
|
search_query_2 |
A search term for the second field to be searched | Example values
|
e.g. /hub/search/documents/?{field}={search_query_1}{operator}{search_query_2}
Number of results
By default, the first 10 results are returned for any query. Additional query Parameters can be added to change this.
Note that the metadata section of the results will have links to the next and previous pages (assuming they exist). Also the maximum value for num_results is 500 .,
Parameters:
value |
The number of results to return. If not specified then a value of 10 is used. | Example values
|
e.g. /hub/search/documents/?q=UNDP&num_results={value}
Offset start of results
By default, the results are returned at the first result for any query. Additional query parameters can be added to change this.
Note that the metadata section of the results will have links to the next and previous pages (assuming they exist).
Parameters:
value |
The index of the result to start from. If not specified then a value of 0 is used. | Example values
|
e.g. /hub/search/documents/?q=UNDP&start_offset={value}
Sort Order
For general q= searching, the results are returned in relevance rank order. For all other searches the default sort order is date_created descending, which displays the most recently added object first. Sort order may be overridden, using the following parameters;
Parameters:
field |
The fields which may be used for sorting. | Example values
|
sort_order |
The method for sorting the results in order of the field named (e.g. ascending or descending. | Example values
|
e.g. /hub/search/documents/?q=gender&{sort_order}={field}
Response formats
Short or Full
Display the full or short version of the item
Parameters:
short_full |
The short or full version of the item | Example values
|
e.g. /hub/search/documents/[short_full}?q=UNDP
Formats available
The data can be returned as JSON or as XML, with JSON as the default.
Parameters:
format |
The method for specifying the response format. | Example values
|
e.g. /hub/search/documents/?q=India&format={format}