Kelum
Kelum

Reputation: 21

Agoda api integration

I am building a channel manager and I stared with agoda. I need to push rates and inventory. I know I need to push data as XML.

How to send the XML string to the EndPoint? for example if the endpoint is

https://sandbox-distribution-xml.agoda.com/api/ari?apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

1) what is the apikey, where can I get it?

2) how to send the XML to EndPoint? (parameters)

sample XML is,

<?xml version="1.0" encoding="UTF-8"?>
<request timestamp="23232931804" type="1">
    <criteria property_id="1949542">
        <inventory>
            <update room_id="5478687">
            <date_range from="2015-10-01" to="2015-10-10">
                <dow>1</dow>
                <dow>2</dow>
                <dow>3</dow>
                <dow>4</dow>
                <dow>5</dow>
                <dow>6</dow>
                <dow>7</dow>
            </date_range>           
            <allotment>9</allotment>
            <restrictions>
                <closed>false</closed>
                <ctd>false</ctd>
                <cta>true</cta>
                </restrictions>
            </update>
        </inventory>
    </criteria>
</request>

Upvotes: 2

Views: 9301

Answers (1)

ZioBit
ZioBit

Reputation: 965

The answer to (1) is that you must register on the https://partners.agoda.com and then you will be able to automatically verify your website (in several ways, I remember at least 2: adding a META tag in your HTML code or uploading an HTML file that they give you on your domain).

The answer to (2) is slightly more complicated and it probably changed in the past years, but it will actually depend on the programming language that you are using. If it's PHP, then you probably want to check the curl command.

Upvotes: 1

Related Questions