May 26, 2024
Creating Users in Adobe Learning Manager with v2 API
Comments
(0)
May 26, 2024
Creating Users in Adobe Learning Manager with v2 API
https://www.linkedin.com/in/anupam-gogoi-97a14888/
Wizard
Followers: 21 people
(0)
    • POST /users

      • Creates a user with the provided details

      Implementation Notes

      Processes the attributes from the API body or JSON payload to generate a user, and subsequently provides a user with the respective user ID filled in. For sizable accounts, these operations are handled asynchronously.

      Response Class (Status 200)

      Operation successful

      • Example Value
      {
        "data": {
          "id": "string",
          "type": "string",
          "attributes": {
            "avatarUrl": "string",
            "binUserId": "string",
            "bio": "string",
            "contentLocale": "string",
            "email": "string",
            "enrollOnClick": true,
            "fields": {},
            "gamificationEnabled": true,
            "lastLoginDate": "string",
            "metadata": {},
            "name": "string",
            "pointsEarned": 0,
            "pointsRedeemed": 0,
            "preferredResolution": "string",
            "profile": "string",
            "roles": [
              "string"
            ],
            "state": "string",
            "timeZoneCode": "string",
            "uiLocale": "string",
            "userType": "string",
            "userUniqueId": "string"
          },
          "relationships": {
            "account": {
              "data": {
                "type": "string",
                "id": "string"
              }
            },
            "manager": {
              "data": {
                "type": "string",
                "id": "string"
              }
            }
          }
        }
      }
          application/vnd.api+json;charset=UTF-8

      Parameters

      Parameter Value Description Parameter Type Data Type
      Sample input payload:
      {
      “data”:
      {
      “type”: “user”,
      “attributes”: {
      “bio”: “”,
      “contentLocale”: “fr-FR”,
      “email”: “someoldemailoftest@work.com”,
      “enrollOnClick”: true,
      “fields”: {
      “Learning Categories”: [
      “Business”
      ],
      “Categories”: “IT”
      },
      “gamificationEnabled”: true,
      “name”: “Test User”,
      “profile”: “Engineer”,
      “userType”: “INTERNAL”,
      “userUniqueId”: “someoldemailoftest@work.com”
      },
      “relationships”: {
      “account”: {
      “data”: {
      “id”: “108079”,
      “type”: “account”
      }
      },
      “manager”: {
      “data”: {
      “id”: “20941371”,
      “type”: “user”
      }
      }
      }
      }
      }

          application/vnd.api+json;charset=UTF-8
      The complete user body post request to create a new user. There are three mandatory attributes. 1.email – email Id of the user. This value should be unique for every user. 2.name – Name of the user. 3.userType – At this point, we can create only internal users. This value should be “INTERNAL”. body
      • Example Value
      {
        "data": {
          "type": "user",
          "attributes": {
            "email": "example@example.com",
            "name": "Bob",
            "userType": "INTERNAL"
          }
        }
      }

      Response Messages

      HTTP Status Code Reason Response Model Headers
      400 A generic http bad request error
      {
        "meta": {
          "error": "string",
          "detail": "string"
        }
      }
      401 A generic http unauthorized access error. Access is denied due to invalid credentials
      {
        "meta": {
          "error": "string",
          "detail": "string"
        }
      }

      Curl 

      curl -X POST --header 'Content-Type: application/vnd.api+json;charset=UTF-8' --header 'Accept: application/vnd.api+json' --header 'Authorization: oauth 2fd8739caecd258732b601ad4fe8e203' -d '{   
         "data":  
           {  
             "type": "user",  
             "attributes": {  
               "bio": "",  
               "contentLocale": "fr-FR",  
               "email": "someoldemailoftest%40work.com",  
               "enrollOnClick": true,  
               "fields": {  
                 "Learning Categories": [  
                   "Business"  
                 ],  
                 "Categories": "IT"  
               },  
               "gamificationEnabled": true,  
               "name": "Test User",  
               "profile": "Engineer",  
               "userType": "INTERNAL",  
               "userUniqueId": "someoldemailoftest%40work.com"  
             },  
             "relationships": {  
               "account": {  
                 "data": {  
                   "id": "108079",  
                   "type": "account"  
                 }  
               },  
               "manager": {  
                 "data": {  
                   "id": "20941371",  
                   "type": "user"  
                 }  
               }  
             }  
           }  
       }' 'https://learningmanager.adobe.com/primeapi/v2/users'

      Request URL 

      https://learningmanager.adobe.com/primeapi/v2/users

      Response Body 

      {
        "links": {
          "self": "https://learningmanager.adobe.com/primeapi/v2/users"
        },
        "data": {
          "id": "24633055",
          "type": "user",
          "attributes": {
            "avatarUrl": "https://cpcontents.adobe.com/public/images/default_user_avatar.svg",
            "email": "someoldemailoftest@work.com",
            "fields": {
              "Learning Categories": "Business",
              "Categories": "IT"
            },
            "name": "Test User",
            "pointsEarned": 0,
            "pointsRedeemed": 0,
            "preferredResolution": "AUTO",
            "profile": "Engineer",
            "roles": [
              "Learner"
            ],
            "state": "ACTIVE",
            "userType": "Internal",
            "userUniqueId": "someoldemailoftest@work.com"
          },
          "relationships": {
            "account": {
              "data": {
                "id": "108079",
                "type": "account"
              }
            },
            "manager": {
              "data": {
                "id": "20941371",
                "type": "user"
              }
            }
          }
        }
      }

      Response Code

      200

      Response Headers

      {
        "access-control-allow-credentials": "true",
        "access-control-allow-headers": "X-acap-all-roles, X-acap-account,X-acap-user,X-acap-caller-role,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, x-experience-api-version, Authorization, X-CSRF-TOKEN, X-HTTP-Method-Override, X-acap-ug-manager-scope, X-acap-extension-token",
        "access-control-allow-methods": "GET, POST, OPTIONS, PUT, HEAD, DELETE, PATCH",
        "access-control-allow-origin": "https://learningmanager.adobe.com",
        "access-control-expose-headers": "Requested-Accept-Language, x-rate-limit, x-burst, x-excess-requests-per-second, Retry-After",
        "age": "-1",
        "cache-control": "no-cache, no-store, max-age=0, must-revalidate",
        "content-length": "637",
        "content-type": "application/vnd.api+json;charset=UTF-8",
        "date": "Sun, 26 May 2024 17:58:06 GMT",
        "expires": "-1",
        "pragma": "no-cache",
        "requested-accept-language": "en-US,en;q=0.9",
        "server": "openresty",
        "server-timing": "server_resp;dur=380",
        "strict-transport-security": "max-age=31536000; includeSubDomains",
        "x-content-type-options": "nosniff",
        "x-frame-options": "SAMEORIGIN",
        "x-request-id": "gwf2a6a7da9565b3552d7d002a9013cf60",
        "x-xss-protection": "1"
      }
0 Comments
Add Comment