Setmore Booking App API

Hi. Hopefully someone can point out how to go about this. I am trying to access info from the Setmore API. I am trying to construct a mobile web app for my wife’s day spa and would like to integrate the API calls into her website. I haven’t gotten far with this.

So far I have been able to use Postman to make a GET request for a token using their supplied refresh_token. Then I was able to make a successful GET request on the Bookingservices api.

Now I would like to know how do I go about using this in an actual Express web app. I’ve tried looking online for references but all the info given to me is a bit over my head at the moment. Does anyone know of a tutorial or link that would help explain Token based API’s in a simpler way?

Hi for making rest call in the express app you can make use of node module called “request”

The code for making setmopre api call will look like this

  request.get(
    { 
        url     :'https://my.setmore.com/api/v1/bookingpage/services',
        headers : { 
                    'Content-Type': 'application/json',
                    'Authorization': 'Bearer <CHANGE_TO_ACCESS_TOKEN_GIVEN_BY_SETMORE>' 
                  },
    },
    (error, response, body) => {
            console.log('error:', error); // Print the error if one occurred
            console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
            console.log('body:', body); // Print the RESPONSE JSON for the SETMORE homepage.
            
    });

And there is one more module call’s node-fetch its work with concepts of promise
Just made an example of it Using some async await concept it sort of code clean look…

I am creating the tutorial+ sample express project with Setmore API
will post you once it is done…

Happy Learning!!