Posting Json values from different application

davidtrillo
Posts: 35
Joined: Tue Mar 21, 2017 10:56 am

Posting Json values from different application

Post by davidtrillo » Wed Jul 11, 2018 7:42 am

I am trying to post JSon data from my Point of Sale system to update Property template 4 with a value which is input to the POS.

I have tested the process using the modifyProperty JSon at https://www.beds24.com/api/json/modifyProperty

I have the following formatted text which is put into the box on this page and subitted. This works perfectly. (NOTE authentication keys hidden for security)

{"authentication":{"apiKey":"XXXXXXXXXXXXX","propKey":"XXXXXXXXX"},"modifyProperty": [{"action":"modify","template4":"160.00"}]}

This updates the Template perfectly.

When I try to Post this identical string from a third party application application nothing happens. Does your page at https://www.beds24.com/api/json/modifyProperty add some other information or headers and if so what are they.

I have used web.Upload, web.PostJson and web.PostData to the url of modify property API but nothing updates. Any ideas please

markkinchin
Site Admin
Posts: 885
Joined: Fri Mar 02, 2012 1:43 pm

Re: Posting Json values from different application

Post by markkinchin » Thu Jul 12, 2018 2:58 pm

Do you have the API IP address's whitelisted? If so make sure the IP of the third party application is also whitelisted.

davidtrillo
Posts: 35
Joined: Tue Mar 21, 2017 10:56 am

Re: Posting Json values from different application

Post by davidtrillo » Sat Jul 14, 2018 6:15 am

For the purposes of testing I have selected post from any IP as I am not yet familiar with whitelisting.

Can you confirm that the API is using TLS1.2 Protocol because of PCI compliance. I am want to make sure the POS system is posting compatible protocols.

I can post using Postmaster and other online API posting sites and it works fine so Its not a problem with the API. Its making sure I configure the POS application properly.

markkinchin
Site Admin
Posts: 885
Joined: Fri Mar 02, 2012 1:43 pm

Re: Posting Json values from different application

Post by markkinchin » Sat Jul 14, 2018 10:54 am

The API accepts TLS1.2, all lower protocols are disabled and will not work.

davidtrillo
Posts: 35
Joined: Tue Mar 21, 2017 10:56 am

Re: Posting Json values from different application

Post by davidtrillo » Mon Jul 16, 2018 5:45 am

thanks for that. Just ensuring my POS server is sending 1.2

Does the API use any sort of Basic Authorisation. I see the scripts include authorisation in the body script. Do I need to authorise any other way to access the API (like Beds24 user/password) or a specific header .

markkinchin
Site Admin
Posts: 885
Joined: Fri Mar 02, 2012 1:43 pm

Re: Posting Json values from different application

Post by markkinchin » Mon Jul 16, 2018 8:11 am

Use the ApiKeys for authentication and IP whitelisting to restrict access only from authorized IP address's

There is no authorization in the headers required

davidtrillo
Posts: 35
Joined: Tue Mar 21, 2017 10:56 am

Re: Posting Json values from different application

Post by davidtrillo » Mon Jul 16, 2018 12:33 pm

Thanks understand no authorisation headers are required.

What other headers are required. i am trying to build a WebClient Class and I am struggling to Post anything.

Is there any way to see a log of any Posts to the API for my account or more importantly any failed attempts which may indicate why my scripts are not working.

markkinchin
Site Admin
Posts: 885
Joined: Fri Mar 02, 2012 1:43 pm

Re: Posting Json values from different application

Post by markkinchin » Mon Jul 16, 2018 4:28 pm

Try pasting your JSON data as text into the form at the API endpoint to make sure your JSON is good.

davidtrillo
Posts: 35
Joined: Tue Mar 21, 2017 10:56 am

Re: Posting Json values from different application

Post by davidtrillo » Mon Jul 16, 2018 5:37 pm

Yes done that and the JSON string works perfectly. I am trying to see if my Post from within my Point of Sale system is being actioned or rejected by the Server.

I have the URL correct, and I create a JSon string which works when pasted into the text box. I also have posted the string using Postmaster and a number of other JSon test sites and each time I get an affirmative message and the property template gets updated (which is the test I am using to prove access to the API).

I have changed the default settings on my Microsoft Server 2017 which is the dtabase platform my POS system operates from (SambaPOS) to ensure that TLS 1.2 is the default protocol. The only thing on Beds24 side is if there are specific headers that I am not sending.

markkinchin
Site Admin
Posts: 885
Joined: Fri Mar 02, 2012 1:43 pm

Re: Posting Json values from different application

Post by markkinchin » Mon Jul 16, 2018 9:49 pm

Do you get any response at all from within your POS system or does the connection fail?

There are no special headers required, all you need to do is simulate the POST as per the other systems that are working

Post Reply