Scopes

Retrieving all scopes

get

Retrieves all scopes for the tenant. Results can be filtered and sorted using query parameters.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
pageNumberinteger · min: 1Optional

Page number to be retrieved. The number of the first page is 1.

Default: 1
pageSizeinteger · min: 1Optional

Number of items to be retrieved per page.

Default: 60
sortstringOptional

List of properties used to sort the results, separated by colons. The order of properties indicates their priority in sorting.

Possible values:

  • {fieldName}
  • {fieldName}:asc
  • {fieldName}:desc

Note: If you want to sort the results by localized properties, the possible values are as follows:

  • {fieldName}.{language}
  • {fieldName}.{language}:asc
  • {fieldName}.{language}:desc

If the sorting direction is not specified, the fields are sorted in ascending order.

qstringOptional

Standard query parameter used to search for specific values.

  • Searching for an item by string property: q=id:31065d5b-b62e, where id is the field name and 31065d5b-b62e is its required value.
  • Searching for an item by localized field property: q=name.en:T-s where name is the name of the field, en is a language code and T-s is a required value of this field. This query works only for localized fields, which are stored in a Map format where key is a language code and value is translation to particular language. + Searching for items by date property. All numer-based property queries are valid also for dates. In that case the date should be placed within double quotes: q=metadata.createdAt:(>="2021-05-18T07:27:27.455Z" AND <"2021-05-20T07:27:27.455Z") + Searching for items with non existing or empty property: q=name.en:null where name.en is a name of fields that has value null. + Searching for items with existing property: q=attributes:exists where attributes is a name of field that has non null value. + Searching for items by multiple specific values: q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494) where id is name of field and strings within a bracket are it''s required value. + Searching for items by multiple fields: q=id:5c3325baa9812100098ff48f name.en:T-s where id and ''name.en'' are the names of fields. All documents that contain given values of these fields are returned. Multiple fields separated by space can be specified. Multiple values for each field can be also specified in a format presented above. + Searching for items with string fields conforming to a regex: q=name.en:~ABCD12 or q=name.en:(~AB CD) - in case of searching for strings with space, where name is the name of field and ABCD12 or AB CD is it''s querying regex.'
Example: id:in(exampleId1,exampleId2)
Header parameters
X-Total-CountbooleanOptional

Flag indicating whether the total number of retrieved items should be returned.

Default: falseExample: true
Responses
chevron-right
200

The request was successful. A list of scopes is returned.

application/json
get
/iam/{tenant}/scopes

Retrieving a scope

get

Retrieves details of a specified scope.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
scopeIdstringRequired

Unique identifier of a scope. Only letters, periods (.), hyphens (-), and underscores (_) are allowed.

Example: custom.scope
Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If the value is specified, then it must be present in the tenant configuration.

  • If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.
  • If the header is set to *, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.
Responses
chevron-right
200

The request was successful. Scope details are returned.

application/json

Definition of a scope.

idstringOptional

Scope identifier.

domainstringOptional

Domain identifier for the scope.

predefinedbooleanRead-onlyOptional

Indicates whether this scope is predefined in the system or was created by a user.

get
/iam/{tenant}/scopes/{scopeId}

Upserting a custom scope

put

Creates a custom scope when it does not exist, or updates it when it already exists for the tenant. If metadata.version is provided, optimistic locking is applied for updates.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
scopeIdstringRequired

Unique identifier of a scope. Only letters, periods (.), hyphens (-), and underscores (_) are allowed.

Example: custom.scope
Body

Payload for creating or updating a scope.

domainstringOptional

Domain identifier for the scope.

Responses
put
/iam/{tenant}/scopes/{scopeId}

Deleting a custom scope

delete

Deletes a custom scope for the tenant.

Note: The scope is removed and cannot be used anymore, but it may still appear on custom credentials that were already created before the deletion.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
scopeIdstringRequired

Unique identifier of a scope. Only letters, periods (.), hyphens (-), and underscores (_) are allowed.

Example: custom.scope
Responses
delete
/iam/{tenant}/scopes/{scopeId}

No content

Last updated

Was this helpful?