How to use REST API to set user profile status? #108473
Answered
by
bewuethr
UlyssesZh
asked this question in
API and Webhooks
-
Select Topic AreaQuestion BodyWe can set profile status. How to do this using REST API? I cannot find it in the API documentation. |
Beta Was this translation helpful? Give feedback.
Answered by
bewuethr
Feb 18, 2024
Replies: 1 comment 1 reply
-
You can't do it in the REST API, but via GraphQL. Using the GitHub CLI, you could do something like this: emoji=':juggling_person:'
status='This is my status'
gh api graphql \
--raw-field emoji="$emoji" \
--raw-field status="$status" \
--raw-field query='
mutation UpdateStatus($emoji: String!, $status: String!) {
changeUserStatus(input:{emoji: $emoji, message: $status}) {
clientMutationId
status {
emoji
message
updatedAt
user {
login
}
}
}
}
' There's also an extension to the GitHub CLI for specifically this: gh-user-status. You can install and use it like this: gh ext install vilmibm/gh-user-status
gh user-status set 'This is my status' --emoji='juggling_person' Be careful about the placement of colons for the emoji string: they're required for the direct GraphQL call, but not required when using the user-status extension. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
UlyssesZh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can't do it in the REST API, but via GraphQL. Using the GitHub CLI, you could do something like this:
There's also an extension to the GitHub CLI for specifically this: gh-user…