Skip to main content

States Available in API for Related Records

APIThe REST API of the 4me service has an advanced feature called States. This feature is used for filtering out the records that are to be retrieved.

For example, you may need to obtain data from internal organizations within your company. In such cases, you can use the following cURL call:

curl -k -u "token:x" -X "https://api.4me.com/v1/organizations?state=internal"

Or even simpler:

curl -k -u "token:x" -X "https://api.4me.com/v1/organizations/internal"

As of today, you can also use states when you are looking up related records. For example, you may need to look up the tasks of change #1234, but you are only interested in the ones that still need to be finished. To accomplish this, the following call can be made:

curl -k -u "token:x" -X "https://api.4me.com/v1/changes/1234/tasks/open"

Another example is a lookup of the notes that are related to request #1010 where you only want the internal ones:

curl -k -u "token:x" -X "https://api.4me.com/v1/requests/1010/notes/internal"

For those of you who are developing 4me integrations, this new capability may very well prove useful.

Note that in the above examples, token represents your 4me API token. You can find your API token in the “Personal Information” section of the Settings console.