REST API "Failed to create service account from Hub, giving up" error

Answered

Hi! I'm trying to receive data from REST Api after Authorization in Hub. Here is my actions:

1. Authenticate application in Hub using Client credentials flow (by the way, is it right flow choice for chat bot?)

POST /api/rest/oauth2/token HTTP/1.1
Host: hub.example.com
Authorization: Basic BLA_BLA
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=YOUTRACK_ID

 

2. Then i'm trying to get issues from YouTrack, using recieved access token

GET /rest/issue HTTP/1.1
Host: yt.example.com
Authorization: Bearer ACCESS_TOKEN
Accept: application/json

Response has status 500 with this message
{"value": "Failed to create service account from Hub, giving up"}

 

What's going on and what should i do? Thanks

0
3 comments
Official comment

Hello Dmitriy,

Apologize for the delay!

Could you please let me know what would you like to implement with this chat-bot? There is already an option to receive notifications and apply commands via Jabber-bot:

https://confluence.jetbrains.com/display/YTD65/Applying+Commands+and+Search+Queries+via+Jabber

https://confluence.jetbrains.com/display/YTD65/Slack+Integration

When sent POST request, did you add YouTrack service ID and its secret within Basic authorization? (https://www.jetbrains.com/help/hub/2.0/Client-Credentials.html) 

Also, if you would like to register new service, please check create it as guided here https://www.jetbrains.com/help/hub/2.0/OAuth-2.0-Authorization.html#SampleScriptForRegisteringClientAsService .

Avatar
Permanently deleted user

Thanks for your answer, but problem already solved: it was internal youtrack error. Updating youtrack to fresher build fix issue.

0

Hello Dmitriy,

Thank you for updates. You are welcome.

0

Please sign in to leave a comment.