Skip to content

Usage with ringcentral-js 4.0 #29

Description

@Brutalbeard

Tried using this with the Alpha 4.0 SDK.

The new SDK doesn't add restapi/v1.0/ to API requests automatically. When using the client with the 4.0 SDK, the URLs being used in the request all return 404.

As an example, in new 4.0,

await rcsdk.platform().get('/restapi/v1.0/account/~/extension/~')
        .then(res => {
            return res.json()
        }).then(res => {
            console.log(res.name)
        }).catch(async e => {
            // console.log(e.apiResponse)
            let error = await e.response.json()
            console.error(error)
        })

Using the client, the following error is returned because the url is incomplete

{ url: 'https://platform.ringcentral.com/account/~',
     status: 404,
     statusText: 'Not Found',
     headers: Headers { [Symbol(map)]: [Object] } } }

I've had a hard time working on the client on my own. Won't build, but was thinking that the constructor could have an option for modifying the url path? Or a flag for which SDK is being used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions