Get site list - Get site list v2
OVERVIEW
Note: the specification has been updated in Collaborate 4.3
This method returns the list of sites a user owns in Collaborate.
Please note that a site which has one of the configuration options enabled as specified in the "callfrom" parameter will not serve the documents using the API, as the configuration settings such as DRM, password protection etc cannot be bypassed using the API at the moment. Until we provide API endpoints that allow you to accept these settings using the API, there is no way to get documents from these sites, doing so will conflict with the Collaborate security policies and hence cannot be achieved using the API at this time.
URL : /api/<version>/sites?
Query string parameters
Parameter Name | Value | Description |
---|---|---|
filterby
|
String |
Possible values are {recent|favourite|category|all} Default for this field is “recent” By default any filter will send back the first 20 sites if pagination is false |
categoryid | Int |
This parameter is used to get the site list based on the site category ID, please provide site categoryid in addition to setting the filterby property to category. example = /api/1/sites?filterby=category&categoryid=1 |
returncount | Int | The no of sites returned. Default is 20. This option does not apply if filterBy property is set to all |
status | String |
A site status available in the system {active|archived|readonly|preparation} Default -> {active + readonly + preparation} for filterBy={recent|favourite| category}] if filterBy={all} is set then all status become applicable. |
Includefolderpermission | Boolean |
{true|false} the default is false |
name | String |
This parameter is used to search a site by name. The site is included in the search result if the string appears in the title of the site. (The results are returned in ascending order) example: Retrieve sites having "HighQ" word in their name: /api/1/sites?name='HighQ' This will return all sites having "HighQ" in their site name. |
callFrom | String |
The only valid value is HIGHQDRIVE. If set the site list filters out any sites that have any restrictions on them. The conditions are as under. 1. 'Visible on HighQ Drive or Office Plugin' check box is not selected in Site->Admin->Advanced page. example: exclude restricted site as: /api/1/sites?callFrom=HIGHQDRIVE |
For an Internal Admin the response XML is as below:
<?xml version="1.0" encoding="UTF-8"?>
<sites>
a list of
site objects
</sites>
For a non-admin response, XML will be as per below :
<?xml version="1.0" encoding="UTF-8"?>
<sites>
<site>
<id>3</id>
<sitename>My site</sitename>
<sitedescription />
<sitefolderID>16</sitefolderID>
<category>
<name>None</name>
</category>
<status>Active</status>
</site>
</sites>
Error Codes:
Code | Meaning |
---|---|
400 | Problem with parsing XML or JSON object (Bad Request) |
401 | Unauthorised |
403 | Validation failed/ Forbidden |
405 | Method not allowed (calling API with the wrong method) |
500 | Internal error occurred |
Thank you. I think I was using the wrong version. With that change and filterby=all, I got them!
Hi Mark Salamon, I'm not seeing that behaviour. Using this endpoint on my instance's SwaggerUI, I get all sites regardless of owner. Are you using Swagger or Postman? The token you are using is definitely your sysadmin account?? Not that it makes any difference from my testing, but also what version of the endpoint are you using?
I'm not sure I understand. I'm asking as a system admin. When I use filterby=all it still returns only the site I am the "owner" of, not all sites.
All sites can be returned for a site admin. Choose all for filterBy parameter
The documentation says it can be used to get all sites a user "owns". As a system admin, is there a way for me to query for a list of every site? Perhaps with a certain parameter or another REST API call?
Thanks. That makes sense - I will contact the support on this site.
Petert Tuffin the site for which you are getting 403 errors, is there anything like a Terms and Conditions page, password protection or any extra security settings? (Admin > Site Settings > Security) enabled?
The default configuration of the application is that we block calls to these sites, as we dont provide a way of 'programatically' engaging with something like a terms and conditions page. Get in touch with support and we can take this setting off, meaning you can make calls to all sites (User permissions permitting!)
I call the Get site list endpoint and am returned a list of sites. I extract the sitefolderID for each of the sites returned. One of them is "mysite", and the other a shared site. I then call the get folder list endpoint, for each of those sitefolderIDs, and receive a status 403 (Access denied) for the "shared" site.
Should I not be able to get a folder list for all of the sites returned by the Get site list?
The strange thing is that I can add folders and files to the shared site (via the HighQ UI), but not to the MySite. It all seems back to front.
Andrew Quinn
Thanks Andrew. I will use that clever work around. I will also place a support ticket.
Hi Shawn Rupert, I can confirm I see the same behaviour (Collaborate 5.1.4.1). Your best bet is to raise a ticket with support@high.com, stating the API does not behave as per documentation. Additionally, when using the filterby=all, the sites returned are the "default" statuses (active + readonly + preparation), contrary to the documentation.
However, if you want to achieve the result you are seeking, you can set the status parameter to a comma-separated list of required statuses, e.g.
This returns all sites with the word "test", and that have any of the following statuses:
- Active
- Archived
- Read-only
- Preparation
This isn't documented anywhere but it works. Regards, Andrew
I responded to your questions but have not received a response back. This is still not working. When I use ?filterby=all I get back all sites, active and archived. If I use ?filterby=all&name=searchForSite I get back only active sites where the site name contains searchForSite. I should be getting back archived sites as well.
Is there an update regarding this?
Imran Aziz , Yes filterby=archived returns the 3 archived sites. The API user is myself and I do have access to all sites as a system administrator. My testing is being performed in Postman.
Shawn Rupert Please note that this is not the latest documentation, the latest documentation is here, when you set filterby=archived does it return you the 3 archived sites? Can you please also confirm that the user has got access to all 7 sites. Thank you.
I am using filterby=all&name=somename. I have 7 sites that include somename. 4 are active and 3 are archived. According to the documentation, if filterBy={all} is set then all status become applicable. I am only seeing the 4 active sites. Should I not see all 7?
Atin Grover your understanding is correct, at the moment we do not have the pagination in sites list API. I have added this to our backlog and will address this in one of our major release. Thanks
Imran Aziz We want to pull all the active sites(approximately 1100) from an instance . Is there a way to achieve this via pagination (or using a combination of filters). As per my understanding, it can only be achieved by "Filterby=all" single API call. Is there a time frame by when this feature will be available?
Thanks
Sheetal Jain this is the first time a client has asked for pagination for the site list API, so I will add this to our backlog. Considering the API has an XML response a few hundred sites should not create any problem. Can you please explain your use case why you think you are going to have thousands of sites? You can private message me if you like. You can try using the various filters available in the site list API to get a subset of sites. For the site name filter, you can use the subset of site name and it will return you the sites matching that search term, using * as a wildcard is not going to work.
Thank you, Imran. Is there any plan to support pagination? If not, what is the time-out setting on the API? If someone has 10k sites ( or maybe the better question may be what is the maximum numbers of sites you have seen) will it work? Does it support wildcard search? e.g. a*, b* ( not an ideal solution but we could make multiple calls to get all sites)
Sheetal Jain I am afraid we do not support pagination in the files list API. If you set filterby=all then you will get a list of all of the sites.
Is there a parameter to get to the next page?
Imran Aziz - this has now been updated as per your request. Thanks.
Comments
21 Comments