Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for project users #58

Closed
zbynekh opened this issue Dec 15, 2021 · 2 comments
Closed

Add support for project users #58

zbynekh opened this issue Dec 15, 2021 · 2 comments
Assignees

Comments

@zbynekh
Copy link

zbynekh commented Dec 15, 2021

Motivation

We have added new endpoints to the Management API for project users and we would like it to be covered in the SDK.
(!) Going to be released in the first half of January 22.

Proposed solution

The SDK should include the functionality of the new endpoints for users:

  • invite user into a project
  • change user roles

Additional context

See Docs preview for more detailed info.

The endpoints that were added:

  • POST /{project_id}/users
    • invites a user into the project
    • sample request body:
{
  "email":"user@example.com",
  "collection_groups":[
    {
      "collections":[
        {
          "id":"00000000-0000-0000-0000-000000000000"
        },
        {
          "codename":"collection-1"
        }
      ],
      "roles":[
        {
          "id":"f58733b9-520b-406b-9d45-eb15a2baee96",
          "languages":[
            {
              "codename":"english"
            }
          ]
        }
      ]
    }
  ]
}
  • sample response:
{
 "user_id":"d94bc87a-c066-48a1-a910-4f991ccc1fb5",
 "collection_groups":[
   {
     "collections":[
       {
         "id":"00000000-0000-0000-0000-000000000000"
       },
       {
         "id":"28b68213-d636-4b01-9fd1-988b93789e17"
       }
     ],
     "roles":[
       {
         "id":"f58733b9-520b-406b-9d45-eb15a2baee96",
         "languages":[
           {
             "id":"7df9a691-cf29-402d-9598-66273e7561b7"
           }
         ]
       }
     ]
   }
 ]
}
  • PUT /{project_id}/users/{user_identifier}/roles
    • changes the users' roles and assignment to collections and languages i current project
    • sample request body:
{
  "collection_groups":[
    {
      "collections":[
        {
          "id":"00000000-0000-0000-0000-000000000000"
        },
        {
          "codename":"collection-1"
        }
      ],
      "roles":[
        {
          "id":"f58733b9-520b-406b-9d45-eb15a2baee96",
          "languages":[
            {
              "codename":"english"
            }
          ]
        }
      ]
    }
  ]
}
  • sample response:
{
 "user_id":"d94bc87a-c066-48a1-a910-4f991ccc1fb5",
 "collection_groups":[
   {
     "collections":[
       {
         "id":"00000000-0000-0000-0000-000000000000"
       },
       {
         "id":"28b68213-d636-4b01-9fd1-988b93789e17"
       }
     ],
     "roles":[
       {
         "id":"f58733b9-520b-406b-9d45-eb15a2baee96",
         "languages":[
           {
             "id":"7df9a691-cf29-402d-9598-66273e7561b7"
           }
         ]
       }
     ]
   }
 ]
}
@Enngage Enngage self-assigned this Dec 15, 2021
@milan009
Copy link

Released on 2022-01-12

@Enngage
Copy link
Contributor

Enngage commented Jan 13, 2022

Released in 2.0.0

@Enngage Enngage closed this as completed Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants