(user)
- getCollaborations - Collaborations
- getCurrentUser - User Information
- getUser - User Information
Provides the set of organizations of which a user is a member or a collaborator.
The set of organizations that a user can collaborate on is composed of:
- Organizations that the current user belongs to across VCS types (e.g. BitBucket, GitHub)
- The parent organization of repository that the user can collaborate on, but is not necessarily a member of
- The organization of the current user's account
import { Circleci } from "circleci-v2-sdk";
async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.user.getCollaborations();
if (res.statusCode == 200) {
// handle response
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetCollaborationsResponse>
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
Provides information about the user that is currently signed in.
import { Circleci } from "circleci-v2-sdk";
async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.user.getCurrentUser();
if (res.statusCode == 200) {
// handle response
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetCurrentUserResponse>
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
Provides information about the user with the given ID.
import { Circleci } from "circleci-v2-sdk";
async function run() {
const sdk = new Circleci({
security: {
apiKeyHeader: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.user.getUser({
id: "bf29e4e9-96b2-49f6-8980-3bb87b43bd7e",
});
if (res.statusCode == 200) {
// handle response
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetUserRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetUserResponse>
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |