getFullUserProfile
getFullUserProfile(variables, init)
getFullUserProfile(
variables
?,init
?):Promise
<TypedResponse
<Response
>>
Low-level function for making a getFullUserProfile
request.
Parameters
• variables?: Variables
Fetches profile associated with any cookies if not provided
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Remarks
This request does not require authentication but some fields will be returned
as null
.
If, for some reason, both kaid
and username
are provided, Khan Academy
will use kaid
and ignore username
.
Link
See
Examples
Get profile by KAID, without error handling:
const response = await queries.getFullUserProfile({ kaid: 'kaid_326465577260382527912172' })
const json = await response.json()
const profile = json.data.user
Similarly, get profile by username:
const response = await queries.getFullUserProfile({ username: 'sal' })
const json = await response.json()
const profile = json.data.user
If no variables are provided or an empty object is passed in, Khan Academy will use any cookies included with the request to fetch the profile associated with them:
const response = await queries.getFullUserProfile(null, {
headers: { cookie: 'KAAS=...' }
})
const json = await response.json()
const profile = json.data.user
Source
src/queries/getFullUserProfile.ts:241
getFullUserProfile(kaid, init)
getFullUserProfile(
kaid
?,init
?):Promise
<TypedResponse
<Response
>>
Parameters
• kaid?: `kaid_${number}`
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Example
Alternative usage by KAID:
const response = await queries.getFullUserProfile('kaid_326465577260382527912172')
const json = await response.json()
const profile = json.data.user
Source
src/queries/getFullUserProfile.ts:254
getFullUserProfile(username, init)
getFullUserProfile(
username
?,init
?):Promise
<TypedResponse
<Response
>>
Parameters
• username?: string
• init?: RequestInit
Returns
Promise
<TypedResponse
<Response
>>
Example
Similarly, by username:
const response = await queries.getFullUserProfile('sal')
const json = await response.json()
const profile = json.data.user