SambaPOS API Integration with NewBook PMS/Booking System

I am reading all sorts but dont even know if its the right thing for what I need. LOL
Everything I get too either seems to be super basic single page JSON examples or overly complex examples :persevere:

Have done some test coding following the single page basic examples and understand the base JSON part.

Look here for a curl tool to help with playing with REST

http://curl.haxx.se/download.html

Also you might get some decent info here:

https://developer.marklogic.com/try/rest/index

That url is about a specific API but it explains it simple. You might get idea from it. The software your using assumes you know how to use it and doesnt explain it well for a beginner.

Am confused on the use of POST URL in the documentation.
From what I see you either POST/PUT or GET which seems to me think like its one way or the other.
How am I ment to POST ‘api_key’ and get a response?
Presumably Im obviously missing something here.

I think you should focus on getting authenticated first.

Thats what I am doing :slight_smile: well trying
I have to make json request of

{
"api_key": "your_api_key_here"
}

to

POST URL: https://testau.newbookpms.com/rest/auth_test

But if im posting the api key how do i pull the test success value

JSON Response:
{
"success": "You have successfully authenticated to NewBook Test Property"
}
Page

try this

https://testau.newbookpms.com/rest/auth_test?Username=blah&Password=blah

change blah accordingly

Something like?

curl -X POST \
-d '{"api_key":"instances_xxxxxxxxxxxxxxxxxxxxxxx"}' \
'https://testau.newbookpms.com/rest/auth_test?user_name=blah&password=blah'

Actually that is probably wrong did you try that curl tool?

I downloaded it but little unsure what im ment to do with it.
Does it allow me to open the test html file locally with curl coding in it?
I am very obviously in over my head :worried:

Am trying outsourcing to india.
Is ajax ok in samba scripting?

Samba usings Jscript.

AJAX = Asynchronous JavaScript and XML.

http://www.w3schools.com/ajax/

Hmmm, google was auto correcting to javascript so maybe an additional cause for confusion on top of my incompetence in either.
Was thinking your were abbreviating Javascript :flushed:
So thats a No?

Not sure how to take this, to me seems like no… tried to lookup the difference but sounds like same base code but microsofts version of suns javascript… but ajax not work with jscript what your saying?

Would gladly pay for someone to get the first call code which I can work off of !!
Anyone interested to take on the challenge?
Am ready to admit I’m going to struggle to get going by myself and in over my head :sleeping:

Let me research it some and I will help you.

Any help is greatly appreciated.
Once the base script is layed down I am confident I can expand myself, just struggling to get off the ground.
From talking to a friend locally it’s the http auth on top of the api which makes it more tricky.

Its the authentication yes. We just need to figure out how they are handling it… It seems like some of their documentation is missing or they are assuming you already know.

Got connected with Rest easy Mozilla plugin pretty quickly.
The URL as listed with basic user/pass auth and the api as data entry but how that translates to script is beyond my abilities.
My friend said he might see what he can work out but php is more his thing.
Looking at your timetrex you were calling in from php files so will see if he can work something out in external file and try to use that like you have.

When you say documentation is missing something what would you expect to be there?
As I said before will request more info but can’t just say is something missing… Don’t want to sound even more incompetent that I do already here :frowning:

@JTRTech, maybe this link can help?

Hello. For next version I’ve implemented web.PostData() function for JScript. Hope it helps.

3 Likes

Any ideas if http auth would work with http://user:password@url.com/rest format? :confounded: