import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
serviceId: "581816",
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.search({});
for await (const page of result) {
console.log(page);
}
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
service_id: '<id>',
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
req = Models::Operations::ClientSearchApiRequest.new
res = s.clients.search(request: req)
unless res.one_of.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithServiceID("581816"),
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Client.Search(ctx, operations.ClientSearchAPIRequest{})
if err != nil {
log.Fatal(err)
}
if res.OneOf != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}curl --request GET \
--url https://us.authlete.com/api/{serviceId}/client/search \
--header 'Authorization: Bearer <token>'{
"limit": 123,
"nextCursor": "<string>",
"totalCount": 123,
"entities": [
{
"number": 1140735077,
"serviceNumber": 715948317,
"clientName": "My Test Client",
"clientId": "1140735077",
"clientSecret": "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
"clientType": "PUBLIC",
"redirectUris": [
"https://example.com/callback"
],
"responseTypes": [
"CODE"
],
"grantTypes": [
"AUTHORIZATION_CODE"
]
}
]
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Search Clients
Search the clients in the requested service that match the condition provided in the q query parameter. Results are returned via cursor based iteration. To iterate through all clients without a search condition, use the /api/{serviceId}/client API instead.
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
serviceId: "581816",
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.search({});
for await (const page of result) {
console.log(page);
}
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
service_id: '<id>',
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
req = Models::Operations::ClientSearchApiRequest.new
res = s.clients.search(request: req)
unless res.one_of.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithServiceID("581816"),
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Client.Search(ctx, operations.ClientSearchAPIRequest{})
if err != nil {
log.Fatal(err)
}
if res.OneOf != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}curl --request GET \
--url https://us.authlete.com/api/{serviceId}/client/search \
--header 'Authorization: Bearer <token>'{
"limit": 123,
"nextCursor": "<string>",
"totalCount": 123,
"entities": [
{
"number": 1140735077,
"serviceNumber": 715948317,
"clientName": "My Test Client",
"clientId": "1140735077",
"clientSecret": "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
"clientType": "PUBLIC",
"redirectUris": [
"https://example.com/callback"
],
"responseTypes": [
"CODE"
],
"grantTypes": [
"AUTHORIZATION_CODE"
]
}
]
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Full description
Full description
Search syntax
A search query is made up of one or more conditions in the format<fieldName><operator><value>. Conditions can be combined with the AND and OR logical operators and grouped with parentheses ().| Operator | Condition | Example |
|---|---|---|
= | Exact equals | clientName=internal-client |
: | Starts with | clientName:internal |
clientName=internal-clientclientIdAlias:client-123 OR clientName:name(clientIdAlias:client OR clientIdAlias:internal) AND clientName:my-prefix
clientName="my client name". Full URI values used with the = operator must also be quoted, e.g. entityId="https://entity-id.example.com".Searchable fields
| Field | Type | Case sensitive | Notes |
|---|---|---|---|
clientId | Integer | N/A | The “starts with” (:) operator performs an exact number comparison. |
clientIdAlias | String | Yes | |
clientName | String | No | |
entityId | URI | Yes | |
metadataDocumentLocation | URI | Yes |
Limits
- The length of the
qparameter is limited to 200 characters by default. - A single search can paginate through at most 1,000 clients by default. Once this limit is reached,
nextCursoris no longer returned. To iterate through more clients than this, use the/api/{serviceId}/clientAPI and filter the results on the client side.
Authorizations
Authenticate every request with a Service Access Token or Organization Token. Set the token value in the Authorization: Bearer <token> header.
Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.
Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.
Both token types are issued by the Authlete console or provisioning APIs.
Path Parameters
The ID of the service to retrieve a list of clients from.
^\d+$Query Parameters
The search query. See the description of this API for the supported syntax and fields.
This parameter is required unless cursor is provided. When cursor is provided, this parameter is ignored and the search query stored in the cursor is used instead.
This should be set to the value of nextCursor from a previous call to this endpoint, which will retrieve the next set of clients matching the original search query. If this is not provided the search will start from the beginning.
The maximum amount of results to return from this request. This value will be clamped between 1 and the allowed maximum. The default will be used if no value is provided.
Indicates whether the totalCount property should be calculated and included in the response, otherwise it will be unset.
Warning: Calculating the total count requires an additional query and reduces the performance and throughput of this API. Only set this to true when the total count is actually required, rather than on every request.
Response
The clamped requested limit of clients to return from the request.
If there are more matching entries to retrieve this value will be generated and returned. The next call to this endpoint should use this value as the cursor to continue to retrieve the remaining clients from the correct point. If there are no further matching clients, or the search pagination limit has been reached, this property will not be set.
The total number of clients in the service that match the search query. This doesn't mean the number of clients contained in the response. Only set when includeTotalCount is true in the request.
The list of clients matching the search query.
Show child attributes
Show child attributes