robinpowered / robin-js-sdk-public

Robin Javascript SDK
https://docs.robinpowered.com
Apache License 2.0
1 stars 3 forks source link

Update this SDK to be inline with current API docs #1

Open findchris opened 7 years ago

findchris commented 7 years ago

For example, there's a call to POST /spaces/:id/events for reserving a room, but this SDK appears not to support it.

Am I missing something? I'd expect to be able to do:

robin.api.spaces.events.create(spaceId, eventData)
findchris commented 7 years ago

I looked around, didn't see anything, so here's a patch.

zachdunn commented 7 years ago

Thanks for the report. We're due for some spring cleaning on this SDK's convenience methods.

In the meantime, you can call endpoints without direct support via the following convention:

sdk.api.POST(`/events/${eventID}`, params).then(response => response.getData());
sdk.api.GET(`/events/${eventID}`).then(response => response.getData());
// etc.

Ref:

findchris commented 7 years ago

👍 on adding the /free-busy/spaces endpoint as well.