Method | HTTP request | Description |
---|---|---|
CreateUser | Post /users | Create user |
DeleteUser | Delete /users/{user_guid} | Delete user |
ListUsers | Get /users | List users |
ReadUser | Get /users/{user_guid} | Read user |
UpdateUser | Put /users/{user_guid} | Update user |
UserResponseBody CreateUser(ctx, body) Create user
Call this endpoint to create a new user. Atrium will respond with the newly-created user object if successful. This endpoint accepts several parameters: identifier, metadata, and is_disabled.
Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month's bill.
package main
import (
"context"
"fmt"
"github.com/mxenabled/atrium-go"
)
func main() {
client := atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID")
ctx := context.Background()
body := atrium.UserCreateRequestBody{} // UserCreateRequestBody | User object to be created with optional parameters (identifier, is_disabled, metadata)
response, _, err := client.Users.CreateUser(ctx, body)
if err != nil {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Response: %s\n", response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | UserCreateRequestBody | User object to be created with optional parameters (identifier, is_disabled, metadata) |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteUser(ctx, userGUID) Delete user
Calling this endpoint will permanently delete a user from Atrium. If successful, the API will respond with Status: 204 No Content.
package main
import (
"context"
"fmt"
"github.com/mxenabled/atrium-go"
)
func main() {
client := atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID")
ctx := context.Background()
userGUID := "USR-123" // string | The unique identifier for a `user`.
response, _, err := client.Users.DeleteUser(ctx, userGUID, )
if err != nil {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Response: %s\n", response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGUID | string | The unique identifier for a `user`. |
(empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsersResponseBody ListUsers(ctx, optional) List users
Use this endpoint to list every user you've created in Atrium.
package main
import (
"context"
"fmt"
"github.com/mxenabled/atrium-go"
"github.com/antihax/optional"
)
func main() {
client := atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID")
ctx := context.Background()
opts := &atrium.ListUsersOpts{
Page: optional.NewInt32(1), // int32 | Specify current page.
RecordsPerPage: optional.NewInt32(12), // int32 | Specify records per page.
}
response, _, err := client.Users.ListUsers(ctx, opts)
if err != nil {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Response: %s\n", response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *ListUsersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a ListUsersOpts struct
Name | Type | Description | Notes |
---|---|---|---|
page | optional.Int32 | Specify current page. | |
recordsPerPage | optional.Int32 | Specify records per page. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserResponseBody ReadUser(ctx, userGUID) Read user
Use this endpoint to read the attributes of a specific user.
package main
import (
"context"
"fmt"
"github.com/mxenabled/atrium-go"
)
func main() {
client := atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID")
ctx := context.Background()
userGUID := "USR-123" // string | The unique identifier for a `user`.
response, _, err := client.Users.ReadUser(ctx, userGUID, )
if err != nil {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Response: %s\n", response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGUID | string | The unique identifier for a `user`. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserResponseBody UpdateUser(ctx, userGUID, optional) Update user
Use this endpoint to update the attributes of a specific user. Atrium will respond with the updated user object.
Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium billing period will not be factored into that month's bill.
To disable a user, update it and set the is_disabled parameter to true. Set it to false to re-enable the user.
package main
import (
"context"
"fmt"
"github.com/mxenabled/atrium-go"
"github.com/antihax/optional"
)
func main() {
client := atrium.AtriumClient("YOUR_API_KEY", "YOUR_CLIENT_ID")
ctx := context.Background()
userGUID := "USR-123" // string | The unique identifier for a `user`.
opts := &atrium.UpdateUserOpts{
Body: optional.NewInterface(atrium.UserUpdateRequestBody{}), // UserUpdateRequestBody | User object to be updated with optional parameters (identifier, is_disabled, metadata)
}
response, _, err := client.Users.UpdateUser(ctx, userGUID, , opts)
if err != nil {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Response: %s\n", response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGUID | string | The unique identifier for a `user`. | |
optional | *UpdateUserOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a UpdateUserOpts struct
Name | Type | Description | Notes |
---|
body | optional.Interface of UserUpdateRequestBody| User object to be updated with optional parameters (identifier, is_disabled, metadata) |
[Back to top] [Back to API list] [Back to Model list] [Back to README]