Added by admin, last edited by admin on Mar 16, 2010  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

BookingBug REST API: company

Purpose

Used for adding/linking affiliates with a company.

[http://[site].bookingbug.com/api/company/add_affiliates/id.format]

id

BookingBug ID of a company

Formats

json, xml

Authentication

Requires business API access

Parameters
param type
description
required?
affiliates affiliates it will contain unique affiliate_id and local reference for an affiliate. affiliate_id is mandatory. You can optionally pass reference. Yes
Examples

XML

curl -basic --url site.bookingbug.com/api/company/add_affiliates/[id_of_company].xml  -uusername:password -H 'Content-type: text/xml' -X POST -d "
<?xml version='1.0' encoding='UTF-8'?>
<company>
    <affiliates>
        <affiliate_id>123</affiliate_id>
        <reference>1</reference>
    </affiliates>
    <affiliates>
        <affiliate_id>1234</affiliate_id>
        <reference>2</reference>
    </affiliates>
    <affiliates>
        <affiliate_id>12345</affiliate_id>
        <reference>3</reference>
    </affiliates>
</company>"

JSON

curl -basic --url http://site.bookingbug.com/api/company/add_affiliates/id_of_company.json -uusername:password -H 'Content-type: application/json' -X POST -d

{"company":{

                   "affiliates":[{

                                    "affiliate_id":"123","reference":"1"

                                    },

                                    {

                                    "affiliate_id":"1234","reference":"2"

                                    },

                                    {

                                    "affiliate_id":"12345","reference":"3"

                                    }

                                   ]

                  }

}