zendesk / sunshine-conversations-javascript

Javascript API for Sunshine Conversations
https://smooch.io
Apache License 2.0
29 stars 13 forks source link

Is documentation out of sync with the code base? #113

Closed hwhelchel closed 6 years ago

hwhelchel commented 6 years ago

I'm working on integrating smooch with an app and the smooch-core-js method signatures are different than the documentation. Am I looking at the wrong docs?

https://docs.smooch.io/rest/#get-app-user

For example the library requires one param to get an appUser but the docs say two params are required.

smooch.appUsers.get(userId) // lib
smooch.appUsers.get(appId, userId) // docs
mspensieri commented 6 years ago

The docs show usage when using account scope access, which requires you to specify an app ID for most routes. When using this library with app scope, the app ID is implied by your secret key, and is therefore not passed as the first argument when making api calls.

var smooch = new SmoochCore({
    keyId: 'app_00000000000',
    secret: 'XXXXXXXXXXX',
    scope: 'app'
});

smooch.appUsers.get(userId)

vs

var smooch = new SmoochCore({
    keyId: 'act_000000000000000',
    secret: 'YYYYYYYYYYYYYY',
    scope: 'account'
});

smooch.appUsers.get(appId, userId)
hwhelchel commented 6 years ago

Thanks!