๐งโโ๏ธUsers
User profile field
SCIM field
Attribute type
Display name
displayName
Singular
Email address
emails
Multi-Valued
Organization
organization
Singular
Job title
title
Singular
Timezone
timezone
Singular
Department
department
Singular
Preferred language
preferredLanguage
Singular
Get a user by ID
GET /scim/directory/{directoryId}/Users/{userId}
Get a user from a directory by userId.
package main
import (
"context"
"github.com/ctreminiom/go-atlassian/admin"
"log"
"os"
)
func main() {
//ATLASSIAN_ADMIN_TOKEN
var scimApiKey = os.Getenv("ATLASSIAN_SCIM_API_KEY")
cloudAdmin, err := admin.New(nil)
if err != nil {
log.Fatal(err)
}
cloudAdmin.Auth.SetBearerToken(scimApiKey)
cloudAdmin.Auth.SetUserAgent("curl/7.54.0")
var (
directoryID = "bcdde508-ee40-4df2-89cc-d3f6292c5971"
userID = "ef5ff80e-9ca6-449c-8cca-5b621085c6c9"
)
user, response, err := cloudAdmin.SCIM.User.Get(context.Background(), directoryID, userID, nil, nil)
if err != nil {
if response != nil {
log.Println("Response HTTP Response", string(response.BodyAsBytes))
}
log.Fatal(err)
}
log.Println("Response HTTP Code", response.StatusCode)
log.Println("HTTP Endpoint Used", response.Endpoint)
log.Println(user.UserName)
log.Println(user.Name)
}Update user via user attributes
PUT /scim/directory/{directoryId}/Users/{userId}
Updates a user's information in a directory by userId via user attributes.
Existing values of unspecified attributes are cleaned.
User information is replaced attribute-by-attribute, with the exception of immutable and read-only attributes.
Deactivate a user
DELETE /scim/directory/{directoryId}/Users/{userId}
Deactivate a user by userId. The user is not available for future requests until activated again. Any future operation for the deactivated user returns the 404 (resource not found) error.
Update user by ID (PATCH)
PATCH /scim/directory/{directoryId}/Users/{userId}
This operation updates a user's information in a directory by userId via PATCH
Get users
GET /scim/directory/{directoryId}/Users
Get users from the specified directory. Filtering is supported with a single exact match (eq) against the userName and externalId attributes.
Pagination is supported.
Sorting is not supported.
Create a user
POST /scim/directory/{directoryId}/Users
Create a user in a directory. An attempt to create an existing user fails with a 409 (Conflict) error. A user account can only be created if it has an email address on a verified domain.
If a managed Atlassian account already exists on the Atlassian platform for the specified email address, the user in your identity provider is linked to the user in your Atlassian organization.
Last updated
Was this helpful?
