diff --git a/README.md b/README.md index 1f6c8fc..d0d4de1 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ Batchbook API ============= -The BB2 API is a RESTful interface for accessing and modifying your account.It supports both XML and JSON and a ruby library will be provided to help build client functionality. +**THIS API IS DEPRECATED AND WILL BE RETIRED SOON. PLEASE CONTACT US FOR MORE DETAILS BEFORE BEGINNING ANY DEVELOPMENT AGAINST IT** + +The BB2 API is a RESTful interface for accessing and modifying your account.It supports both XML and JSON and a ruby library will be provided to help build client functionality. Endpoints --------- * [People](https://github.com/batchblue/batchbook-api/blob/master/sections/people.md) * [Companies](https://github.com/batchblue/batchbook-api/blob/master/sections/companies.md) * [Custom Fields](https://github.com/batchblue/batchbook-api/blob/master/sections/custom_fields.md) +* [Affiliations](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliations.md) +* [Affiliation Types](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliation_types.md) * [Users](https://github.com/batchblue/batchbook-api/blob/master/sections/users.md) * [Roles](https://github.com/batchblue/batchbook-api/blob/master/sections/roles.md) -* [Communications](https://github.com/batchblue/batchbook-api/blob/master/sections/communications.md) +* [Communications](https://github.com/batchblue/batchbook-api/blob/master/sections/communications.md) Authentication -------------- diff --git a/sections/affiliation_types.md b/sections/affiliation_types.md new file mode 100644 index 0000000..457e9aa --- /dev/null +++ b/sections/affiliation_types.md @@ -0,0 +1,68 @@ +Affiliation Types +============= + +### Methods + +* [Show](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliation_types.md#show) +* [Create](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliation_types.md#create) + +[XML Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-type-xml) + +[JSON Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-type-json) + +Show +--- +* `GET /api/v1/affiliation_types/#{id}.xml or .json` returns a single affiliation type. + +**Response:** + +[XML Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-xml) + +[JSON Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-json) + + +Create +--- + +* `POST api/v1/affiliation_types.xml or .json` creates a new affiliation type + +**Request:** + +```xml + + 8 + Parent + Child + +``` + +```json +{ + "affiliation_type": { + "id":8, + "name":"Parent", + "reciprocal_name":"Child" + } +} +``` + +**Response:** + + Status: 201 Created + Location: https://your_account.batchbook.com/api/v1/affiliation_types/the_new_id.{json or xml} + +```xml + + ... + +``` + +```json +{ + "affiliation_type": + { + "id":the_new_id + ... + } +} +``` diff --git a/sections/affiliations.md b/sections/affiliations.md new file mode 100644 index 0000000..fe41067 --- /dev/null +++ b/sections/affiliations.md @@ -0,0 +1,72 @@ +Affiliations +============= + +### Methods + +* [Show](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliations.md#show) +* [Create](https://github.com/batchblue/batchbook-api/blob/master/sections/affiliations.md#create) + +[XML Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-xml) + +[JSON Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-json) + +Show +--- +* `GET /api/v1/affiliations/#{id}.xml or .json` returns a single affiliation. + +**Response:** + +[XML Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-xml) + +[JSON Data Reference](https://github.com/batchblue/batchbook-api/blob/master/sections/data_reference.md#affiliation-json) + + +Create +--- + +* `POST api/v1/affiliations.xml or .json` creates a new affiliation + +**Request:** + +```xml + + 1035 + Contact + 1044 + Contact + 7 + +``` + +```json +{ + "affiliation": { + "affiliate_id":1035, + "affiliate_type":"Contact", + "affiliator_id":1044, + "affiliator_type":"Contact", + "affiliation_type_id":7 + } +} +``` + +**Response:** + + Status: 201 Created + Location: https://your_account.batchbook.com/api/v1/affiliations/the_new_id.{json or xml} + +```xml + + ... + +``` + +```json +{ + "affiliation": + { + "id":the_new_id + ... + } +} +``` diff --git a/sections/data_reference.md b/sections/data_reference.md index f8abbba..b98be8c 100644 --- a/sections/data_reference.md +++ b/sections/data_reference.md @@ -977,3 +977,54 @@ Communication JSON } ``` +Affiliation Type XML +---- +``` xml + + 8 + Parent + Child + +``` + +Affiliation Type JSON +---- + +``` json +{ + "affiliation_type": { + "id":8, + "name":"Parent", + "reciprocal_name":"Child" + } +} +``` + +Affiliation XML +---- +``` xml + + 8 + 1035 + Contact + 1044 + Contact + 7 + +``` + +Affiliation JSON +---- + +``` json +{ + "affiliation": { + "id":8, + "affiliate_id":1035, + "affiliate_type":"Contact", + "affiliator_id":1044, + "affiliator_type":"Contact", + "affiliation_type_id":7 + } +} +```