SambaPOS API Integration with NewBook PMS/Booking System

So I thought I would start a fresh topic for this project.

After a few emails putting SambaPOS forward to them as a new EPOS software to integrate with I have now received their API documentation and offer of a testing account when ready.

I am eager to learn the required code and do all I can myself but will post my progress but any help will be appreciated.

I have the API documentation, not sure if its something I can post publicly or not (not worked with APIs before) but I had to request it - it want freely available on their site, doesn’t say anything preventing it and the code will show all anyway.

For reference the newbook site is http://www.newbookpms.co.uk/
Thats their UK site however their head office is in Australia.
It lists some tidy features like plenty of other interrogations with channel managers etc , online booking, PBX call loging, access control for doors and gates etc and other bits like paperless checkin and an interface compatible with computers tablets and phones.

Anyway my aims;

  • Room entities with checked in status as a filter so only checked in rooms show/active with usual status.
  • Room entity tickets to be posted to the room account within the booking system
  • Non room post sales figures to be transferred into PMS accounts - presumably at end of work period.
4 Likes

Did they require payment for API? Usually it’s ok to share API I mean you can’t use it without software anyway.

1 Like

No payment, if any development needed their end is evaluated on a demand basis which is where I first struggled.
After explaining that Samba being as versatile and powerful as it is there would unlikely be anything needing doing there end as should be able to have Samba fit in with their existing API etc.
Then pointed out that there were 40k downloads on the last version and used worldwide and an integration would undoubtedly have great potential.

Is their software local or cloud based?

Cloud based.
Personally prefer local but seems good setup and as I said the other hotels in the group use it.
Also cloud based does generally seem to be more open to further interrogations with online other services.
This it works for the booking side but would never want a cloud based EPOS system where constant use vs a booking system which is less heavily used at point of sale.
Also booking side is more important to have solid links to online services like chanel managers and online booking etc.

That makes sense why they do integrations need base. Typically that sort of thing does require some server side setup. Timetrex for example, it has JSON API but you still need to make some server side scripts to enable it. This is not always the case, Google API for example but you would need to study it to find out.

If it does need some server side setup you should find out their method, do they do it for you by request or do they provide secure access to it for you to edit scripts etc. typically they would need to do it for you. You can get a good idea of how it works through API documentation. Ask them if you can share API with our community and we can help integration efforts. It might benefit them as well.

I have emailed them just to confirm its ok to share on forum.

Have just watched a couple of JSON tutorials to try and get to grips with the format of things and while I understand the principles of what I watched in the video the code looks to have different structure to what I have seen some of the posts showing the code.
I cant see any ‘samba script basics’ posts, have I missed it?
What code language should be used in the scripts?

JSON is not code. its a method. Here is an example of me using JSON with Google Maps API

function gdistance(origin,destination)

{

var nl = '<linebreak/>';

var u = 'http://maps.googleapis.com/maps/api/distancematrix/json?origins='+origin+'.&destinations='+destination+'.&mode=driving&language=en-US&sensor=false&units=metric';

var alldata = web.Download(u);

var json = JSON.parse(alldata);

var distance = json.rows[0].elements[0].distance.value;

var duration = json.rows[0].elements[0].duration.text;

return distance;

}
2 Likes

Thanks, sorry for my ignorance :confused:

Is there a Samba scripts tutorial/basics on the forum? couldn’t find one.
What core code(s) should scripts be based on?

Just looking to clarify the basics so I know I am reading up on the right things.

You will use JScript. Most of the helpers are documented in features post.

1 Like

Thanks, thought that would be the case but didn’t want to say encase wrong LOL

BTW a helper would be the JSON.parse() you see in above code. There are other helpers documented in features. web.Download() is another helper used in the example.

AFAIK, Automation > Scripts only supports JScript (the MS version of JavaScript) and SQL scripts, but not both together at the same time. It may support other languages, but Emre has not revealed any such feature.

And as @Jesse mentions, Emre has built-in or exposed a lot of helper objects/classes for use in JScript.

1 Like

Got my work cut out LOL, have given myself the aim of having made enough progress in next month to know it can (well I can) do it and be able to put plan forward to GM with aim on implimenting after Christmas when bookings for 2016 are lowest and best time to make the switch of booking system and obviously till system to go with it :smile:
Not sure yet how realistic that is, got allot on over weekend so need to nucker down and get learning next week

We can help don’t hesitate to ask when you get stumped.

1 Like

Appreciated, will be speaking to you Monday then LOL

As first time even looking at scripts in Samba just trying to at least understand the workflow in Samba which is the side I understand more about :smile:
Is where scripts actually get implemented.

There is execute script but presume this is to run an automation type script.

As what I think should be a simpler example;
If you wanted to say update an entity field, say because I wanted to setup custom entity grid to show guest name next to room number.
My first impression would be an update entity data action with field value of {CALL:xxxx} where xxxx is the script name for the script which would look up the guest name for the room??
Obviously variable actions add an additional complexity but just as a basic example if I wanted to updated room 1 with room 1’s guest name.

Hopefully I’m not too far wrong with this?

Your correct CALL:X will return whatever value your function returns granted it’s valid and formatted for what your doing correctly.

There is a built in way to test your functions without leaving the script editor it’s located bottom right.

1 Like

Nice one, step 1 of 99 ticked LOL
Actually that is a revilement as after the general tutorial video I watched was thinking I would be getting big list of the values dumped but now the JSON basics part makes more sense in being able to pull a specific value without getting everything in a lump.
And am imagining I could have an entity data field of the room ID used on the site so this can be used as a ‘variable’ hopefully using in one way or another the ‘{tags}’ in the function/lookup.