Create sign-in code
Creates a sign-in code for a public client, such as a CLI, so a user can approve the login in HQ from any browser. This is the device authorization endpoint of the OAuth 2.0 device authorization grant (RFC 8628).
Show the user_code and verification_uri to the user, then poll the token endpoint with
grant_type=urn:ietf:params:oauth:grant-type:device_code and the device_code, no faster than interval seconds.
Until the user decides, the token endpoint answers authorization_pending; polling too fast answers slow_down,
a denied request access_denied, and an expired one expired_token.
POST
/v1/hq/oauth/sign_in_codesclient_id*string
Example
"7awdXwZoedakjad37a"scope?string
Space-delimited list of scopes to request. If omitted, all scopes of the application are requested.
Example
"companies:read customers:read"Response Body
application/json
application/json
application/json
curl -X POST "https://api.noona.is/v1/hq/oauth/sign_in_codes" \ -H "Content-Type: application/json" \ -d '{ "client_id": "7awdXwZoedakjad37a" }'{
"device_code": "nodc_GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://hq.noona.app/oauth/code",
"verification_uri_complete": "https://hq.noona.app/oauth/code?user_code=WDJB-MJHT",
"expires_in": 900,
"interval": 5
}{
"error": "invalid_request"
}{
"error": "invalid_request"
}Empty