Flowdock: REST API - How can I find the sub-organizations of a given organization?
Document ID :
Last Modified Date :
Show Technical Document Details
AGILE CENTRAL SAAS:ACSAAS
Is there a way to use Flowdock's REST API to find the sub-organizations of a given organization?
The short answer to this is: "No. The REST API itself does not provide a mean to find the sub-organizations".
we do have a way
Let's start by finding our organization using Flowdock's REST API:
This is a call that finds an organization with an id of "ABC":
This will return:
You can see the returned JSON of our ABC organization. As you can tell there is no section for sub-organizations. This is why there isn't a straight forward way to get the sub-organizations.
Yet, note that there is a property named:
. In this case it is set to 'null' . This means our "ABC" organization is not parented by any other organization.
This suggests we may be able to use this property to query for the sub-organizations in such a way:
The above query basically is attempting to find all organizations that have a
set to 'ABC'.
The problem with this though, is that the /find method does not support query by this argument
. If you try this out you'll result with: "Access Denied".
Yet, there is a way to find the sub-organizations. Here is how:
We need to make a call to /organizations :
This will return all organizations authorized under the Token used in this query. This returns blocks of JSON sections such as above for all organizations. At that point you can use a simple program, locate all the lines where
These will be the lines that are part of all the sub-organizations you are looking for.
More on Flowdock's REST API:
More on Flowdock's REST API for Organization:
Was this information helpful?