Alexa-skills-kit-sdk-for-nodejs: updateAccountLinkingInfoV1 is not working

Created on 18 Sep 2020  路  3Comments  路  Source: alexa/alexa-skills-kit-sdk-for-nodejs

the method updateAccountLinkingInfoV1 is not working, the server returns such error:

{
  statusCode: 400,
  body: '{"message":"Account linking information is not valid.","violations":[{"code":"INVALID_REQUEST_PARAMETER","message":"Parsing error due to empty body.","validationDetails":{"originalInstance":{"type":"BODY"},"reason":{"type":"EXPECTED_NOT_EMPTY_VALUE"}}}]}',
  headers: [...]
}

after some investigation, I've found that this method sends the data in the body in the wrong format:

{
  url: 'https://api.amazonalexa.com/v1/skills/.../stages/development/accountLinkingClient',
  method: 'PUT',
  headers: [...],
  body: '{"type":"AUTH_CODE","scopes":[""],"domains":[""],"clientId":"id","clientSecret": "...", "accessTokenUrl":"https://example.com","authorizationUrl":"https://example.com","accessTokenScheme":"HTTP_BASIC","defaultTokenExpirationInSeconds":3600,"skipOnEnablement":false}'
}

but the correct request should contain linking data in the accountLinkingRequest field:

{
  url: 'https://api.amazonalexa.com/v1/skills/.../stages/development/accountLinkingClient',
  method: 'PUT',
  headers: [...],
  body: '{"accountLinkingRequest": {"type":"AUTH_CODE","scopes":[""],"domains":[""],"clientId":"id","clientSecret": "...", "accessTokenUrl":"https://example.com","authorizationUrl":"https://example.com","accessTokenScheme":"HTTP_BASIC","defaultTokenExpirationInSeconds":3600,"skipOnEnablement":false}}'
}

P.S.
issue in alexa-apis-for-nodejs: https://github.com/alexa/alexa-apis-for-nodejs/issues/10
PR in alexa-apis-for-nodejs: https://github.com/alexa/alexa-apis-for-nodejs/pull/11

bug

All 3 comments

Hi @z4o4z ,

Thanks for point this issue out. Since our model pkg is auto-generated, thus we won't accept PR for the fix. Instead, we will fix this issue and release new model pkg soon.

Thanks,
Shen

Hi @z4o4z ,

ask-smapi-model 1.12.1 was released with following changes: https://github.com/alexa/alexa-apis-for-nodejs/commit/acf06346c740d5e923e4cc13a097637046aec693. Could you please update model version and let us know if it works correctly.

Thanks,
Shen

Close this issue for now, please reopen if the issue still exit.

Thanks,
Shen

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slesem picture slesem  路  4Comments

ancashoria picture ancashoria  路  6Comments

developer170883 picture developer170883  路  4Comments

kevinwu picture kevinwu  路  3Comments

svonkleeck picture svonkleeck  路  7Comments