1
- # adobe-umapi.py
1
+ # adobe-umapi-client .py
2
2
3
- Python client for the Adobe User Management API, aka the
4
- [ Adobe UMAPI] ( https://www.adobe.io/products/usermanagement/docs/gettingstarted.html )
3
+ This is a Python client for the Adobe User Management API, aka the
4
+ [ Adobe UMAPI] ( https://www.adobe.io/products/usermanagement/docs/gettingstarted.html ) .
5
+
6
+ The Adobe User Management API is an Adobe-hosted network service
7
+ which provides Adobe Enterprise customers the ability to manage their users. This
8
+ client makes it easy to access the Adobe UMAPI from a local Python application.
9
+
10
+ This client is open source, maintained by Adobe, and distributed under the terms
11
+ of the OSI-approved MIT license. Copyright (c) 2016 Adobe Systems Incorporated.
5
12
6
13
# Installation
7
14
8
- You can get this package from PyPI: ` pip install adobe-umapi ` .
15
+ You can get this package from PyPI: ` pip install adobe-umapi-client ` .
9
16
Or you can download the posted package from GitHub and use pip
10
17
to install from the download.
11
18
12
- (Note: as of 13 Dec 2016, there was an issue with the PyPI posting.
13
- We are working to fix that problem.)
14
-
15
19
# Building
16
20
17
21
1 . Clone this repository or download the latest stable release.
18
- 2 . From the command line, change to the ` adobe-umapi.py ` directory.
22
+ 2 . From the command line, change to the ` adobe-umapi-client .py ` directory.
19
23
3 . To install, run the command ` python setup.py install ` .
20
24
[ ** NOTE** : You may need admin/root privileges to install new packages in your environment.
21
25
It is recommended that you use ` virtualenv ` to make a virtual python environment.
@@ -62,7 +66,7 @@ The JSON Web Token (JWT) is used to get an authorization token for using the API
62
66
The ` JWT ` object will build the JWT for use with the ` AccessRequest ` object.
63
67
64
68
``` python
65
- from adobe_umapi .auth import JWT
69
+ from adobe_umapi_client .auth import JWT
66
70
67
71
jwt = JWT(
68
72
org_id, # Organization ID
@@ -79,7 +83,7 @@ The `AccessRequest` object uses the JWT to call an IMS endpoint to obtain an acc
79
83
token is then used in all later UMAPI calls to authenticate and authorize the request.
80
84
81
85
``` python
82
- from adobe_umapi .auth import AccessRequest
86
+ from adobe_umapi_client .auth import AccessRequest
83
87
84
88
token = AccessRequest(
85
89
" https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -103,7 +107,7 @@ Once you have an access `token`, you use it to create an Auth object. This Auth
103
107
is used to build the necessary authentication headers for making an API call.
104
108
105
109
``` python
106
- from adobe_umapi .auth import Auth
110
+ from adobe_umapi_client .auth import Auth
107
111
108
112
auth = Auth(api_key, token())
109
113
```
@@ -114,7 +118,7 @@ Once the `auth` object is built, you use it to construct a UMAPI object. This U
114
118
object can then be used over and over to make your desired API calls.
115
119
116
120
``` python
117
- from adobe_umapi import UMAPI
121
+ from adobe_umapi_client import UMAPI
118
122
119
123
api_endpoint = ' https://usermanagement.adobe.io/v2/usermanagement'
120
124
api = UMAPI(api_endpoint, auth)
@@ -124,15 +128,15 @@ api = UMAPI(api_endpoint, auth)
124
128
125
129
These snippets presume you have constructed a UMAPI object named ` api ` as detailed in the last section.
126
130
The query APIs return data in paginated form, each page contaning up to 200 results.
127
- The ` adobe_umapi .helper`
131
+ The ` adobe_umapi_client .helper`
128
132
module has a ` paginate ` utility which can will concatenate and return the results from all pages.
129
133
130
134
## Get a List of Users
131
135
132
136
``` python
133
137
users = api.users(org_id, page = 0 ) # optional arg page defaults to 0
134
138
135
- from adobe_umapi .helper import paginate
139
+ from adobe_umapi_client .helper import paginate
136
140
all_users = paginate(api.users, org_id) # optional args for max_pages and max_records
137
141
```
138
142
@@ -158,7 +162,7 @@ To create the action object, we name the user we wish to operate on.
158
162
(As above, ` api ` here in a UMAPI object.)
159
163
160
164
``` python
161
- from adobe_umapi import Action
165
+ from adobe_umapi_client import Action
162
166
163
167
action
= Action(
user = " [email protected] " )
164
168
```
@@ -443,9 +447,9 @@ The "add" portion of the JSON looks like this:
443
447
"add" : {"product" : [" product1" ]}
444
448
```
445
449
446
- ## adobe_umapi .auth
450
+ ## adobe_umapi_client .auth
447
451
448
- The submodule ` adobe_umapi .auth` contains the components needed to build
452
+ The submodule ` adobe_umapi_client .auth` contains the components needed to build
449
453
the authentication headers needed for API communication.
450
454
451
455
### JWT
@@ -466,7 +470,7 @@ The `JWT` object is callable. Calling it returns the encoded JWT.
466
470
Example:
467
471
468
472
``` python
469
- from adobe_umapi .auth import JWT
473
+ from adobe_umapi_client .auth import JWT
470
474
471
475
jwt = JWT(
472
476
org_id, # Organization ID
@@ -495,7 +499,7 @@ Like the `JWT` object, the `AccessRequest` object is callable. Calling it retur
495
499
Basic Usage Example:
496
500
497
501
``` python
498
- from adobe_umapi .auth import AccessRequest
502
+ from adobe_umapi_client .auth import AccessRequest
499
503
500
504
token = AccessRequest(
501
505
" https://" + ims_host + ims_endpoint_jwt, # Access Request Endpoint (IMS Host + JWT Endpoint)
@@ -529,15 +533,15 @@ It is a subclass of the
529
533
Example:
530
534
531
535
``` python
532
- from adobe_umapi .auth import Auth
536
+ from adobe_umapi_client .auth import Auth
533
537
534
538
token = AccessRequest( ... )
535
539
auth = Auth(api_key, token())
536
540
```
537
541
538
- ## adobe_umapi .error
542
+ ## adobe_umapi_client .error
539
543
540
- The ` adobe_umapi .error` submodule contains all custom Exceptions for the UMAPI library.
544
+ The ` adobe_umapi_client .error` submodule contains all custom Exceptions for the UMAPI library.
541
545
542
546
### UMAPIError
543
547
0 commit comments