//native
/**
* Get User
* Fetch a single user by their Okta ID, login, or login shortname.
*/
export async function main(auth: RT.Okta, user_id: string) {
const url = new URL(
`${auth.org_url}/api/v1/users/${encodeURIComponent(user_id)}`
)
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `SSWS ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 6 days ago