Hi guys,
are those Request body filters available to call this API? I'm trying with postman but nothing happen using those filters, only 'limit' works.
Best,
Antonello
Hello @Antonello Storelli
You referred to "those filters" but didn't say which ones you were trying to use, what their name is or what their purpose is.
The endpoint you provided a link to supports only two request parameters, orgId and cursor; there are no 'filter' parameters that it supports.
It would help if you provided a complete example of the request you're trying to send, including the full request path, all parameters and their values.
Hi @David Bakkers !
I was trying to use this one: https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v1-orgs-orgid-users-search-post
As you can see there are more filters that you 'can use' (as they described) in the request of the payload, but I am not able to use them, did I understand wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is not the same endpoint that you provided a link to in your original question, that is a different one.
Those things you are calling 'filters' are called parameters and go into the body of the request to define aspects of the request.
What EXACTLY do you mean by "I am not able to use them"? You still haven't provided the complete example of the request you're trying to send, including the full request method, path and all body parameters and their values.
Without this detailed information, there is no way to just randomly guess what you might be doing and what the problem might be.
Also, are you completely, absolutely positive your organisation has the new user management experience in place, which is declared in that endpoint's documentation:
Returns a list of users with applied privacy controls in an organization using the new user management experience
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
I know where they are, into the body request, and the parameters are used to filter results, so, to me, they are filters. If I don't put any of them I get all the records, instead, if I put a parameter called 'limit:20' I filter the result to 20 records. So they are filter. It doesn't matter anyway.
The API works with the standard limit parameter:
If I try for example 'accountStatuses' to filter only inactive users it didn't work to me. i did it in this way:
Antonello
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Antonello Storelli
You're not forming the request body's JSON properly. The documentation says those parameters require an array<string>, not a string. In JSON, arrays are wrapped in double brackets ie: [ "string1", "string2", "etc"]
The format of your request body should be something like this:
{
"limit": 20,
"isSuspended": "false",
"accountTypes": ["atlassian","app"],
"accountStatuses": ["ACTIVE"],
"expand": ["EMAIL","NAME"]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Bakkers the problem I am facing is that when searching by emailUsernames it requires one of two child properties, both of which require an array of strings: eq and contains.
I am using the JSON below which is valid and returns an HTTP 200:
I think that I must not understand what emailUsernames is searching on because when I use the same JSON structure for emailDomains as shown below it does return the expected accounts:
My objective is to fetch the account ID of the account having a specific e-mail address so my assumption was that emailUsernames was the way to do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out how emailUsernames works, it only wants the string before the domain so this is the proper JSON format when I am searching for an account which has e-mail address username@example.com:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, the documentation for these endpoints is sparse, to say the least. Thankfully, I don't have to interact with them very often :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello folks! No one is using it? No one can help me to understand how it works?
Best,
Antonello
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
accountStatuses shows that it wants an array of strings so my assumption is that the JSON body would use the following:
"accountStatuses": ["inactive"]
That doesn't work however as it returns an HTTP 400 error. That really surprised me because accountIds also shows it wants an array of strings and the JSON below returns the correct account:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.