@@ -66,11 +66,11 @@ The JSON Web Token (JWT) is used to get an authorization token for using the API
66
66
The ` JWT ` object will build the JWT for use with the ` AccessRequest ` object.
67
67
68
68
``` python
69
- from adobe_umapi_client .auth import JWT
69
+ from umapi_client .auth import JWT
70
70
71
71
jwt = JWT(
72
72
org_id, # Organization ID
73
- tech_acct, # Techincal Account ID
73
+ tech_acct, # Technical Account ID
74
74
ims_host, # IMS Host
75
75
api_key, # API Key
76
76
open (priv_key_filename, ' r' ) # Private certificate is passed as a file-like object
@@ -83,7 +83,7 @@ The `AccessRequest` object uses the JWT to call an IMS endpoint to obtain an acc
83
83
token is then used in all later UMAPI calls to authenticate and authorize the request.
84
84
85
85
``` python
86
- from adobe_umapi_client .auth import AccessRequest
86
+ from umapi_client .auth import AccessRequest
87
87
88
88
token = AccessRequest(
89
89
" https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -107,7 +107,7 @@ Once you have an access `token`, you use it to create an Auth object. This Auth
107
107
is used to build the necessary authentication headers for making an API call.
108
108
109
109
``` python
110
- from adobe_umapi_client .auth import Auth
110
+ from umapi_client .auth import Auth
111
111
112
112
auth = Auth(api_key, token())
113
113
```
@@ -118,7 +118,7 @@ Once the `auth` object is built, you use it to construct a UMAPI object. This U
118
118
object can then be used over and over to make your desired API calls.
119
119
120
120
``` python
121
- from adobe_umapi_client import UMAPI
121
+ from umapi_client import UMAPI
122
122
123
123
api_endpoint = ' https://usermanagement.adobe.io/v2/usermanagement'
124
124
api = UMAPI(api_endpoint, auth)
@@ -127,22 +127,23 @@ api = UMAPI(api_endpoint, auth)
127
127
# Querying for Users and Groups
128
128
129
129
These snippets presume you have constructed a UMAPI object named ` api ` as detailed in the last section.
130
- The query APIs return data in paginated form, each page contaning up to 200 results.
131
- The ` adobe_umapi_client .helper`
130
+ The query APIs return data in paginated form, each page containing up to 200 results.
131
+ The ` umapi_client .helper`
132
132
module has a ` paginate ` utility which can will concatenate and return the results from all pages.
133
133
134
134
## Get a List of Users
135
135
136
136
``` python
137
137
users = api.users(org_id, page = 0 ) # optional arg page defaults to 0
138
138
139
- from adobe_umapi_client .helper import paginate
139
+ from umapi_client .helper import paginate
140
140
all_users = paginate(api.users, org_id) # optional args for max_pages and max_records
141
141
```
142
142
143
143
## Get a List of Groups
144
144
145
- This list of groups will contain both user groups and product license configuration groups.
145
+ This list of groups will contain both user groups and product license
146
+ configuration groups.
146
147
147
148
``` python
148
149
groups = api.groups(org_id, page = 0 )
@@ -162,7 +163,7 @@ To create the action object, we name the user we wish to operate on.
162
163
(As above, ` api ` here in a UMAPI object.)
163
164
164
165
``` python
165
- from adobe_umapi_client import Action
166
+ from umapi_client import Action
166
167
167
168
action
= Action(
user = " [email protected] " )
168
169
```
@@ -447,9 +448,9 @@ The "add" portion of the JSON looks like this:
447
448
"add" : {"product" : [" product1" ]}
448
449
```
449
450
450
- ## adobe_umapi_client .auth
451
+ ## umapi_client .auth
451
452
452
- The submodule ` adobe_umapi_client .auth` contains the components needed to build
453
+ The submodule ` umapi_client .auth` contains the components needed to build
453
454
the authentication headers needed for API communication.
454
455
455
456
### JWT
@@ -470,11 +471,11 @@ The `JWT` object is callable. Calling it returns the encoded JWT.
470
471
Example:
471
472
472
473
``` python
473
- from adobe_umapi_client .auth import JWT
474
+ from umapi_client .auth import JWT
474
475
475
476
jwt = JWT(
476
477
org_id, # Organization ID
477
- tech_acct, # Techincal Account ID
478
+ tech_acct, # Technical Account ID
478
479
ims_host, # IMS Host
479
480
api_key, # API Key
480
481
open (priv_key_filename, ' r' ) # Private certificate is passed as a file-like object
@@ -499,7 +500,10 @@ Like the `JWT` object, the `AccessRequest` object is callable. Calling it retur
499
500
Basic Usage Example:
500
501
501
502
``` python
502
- from adobe_umapi_client.auth import AccessRequest
503
+ from umapi_client.auth import AccessRequest
504
+
505
+ ims_host = ' ims-na1.adobelogin.com' # US production host, usable from everywhere
506
+ ims_endpoint_jwt = ' /ims/exchange/jwt' # path for all environments
503
507
504
508
token = AccessRequest(
505
509
" https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -533,15 +537,15 @@ It is a subclass of the
533
537
Example:
534
538
535
539
``` python
536
- from adobe_umapi_client .auth import Auth
540
+ from umapi_client .auth import Auth
537
541
538
542
token = AccessRequest( ... )
539
543
auth = Auth(api_key, token())
540
544
```
541
545
542
- ## adobe_umapi_client .error
546
+ ## umapi_client .error
543
547
544
- The ` adobe_umapi_client .error` submodule contains all custom Exceptions for the UMAPI library.
548
+ The ` umapi_client .error` submodule contains all custom Exceptions for the UMAPI library.
545
549
546
550
### UMAPIError
547
551
0 commit comments