Skip to content

Commit

Permalink
Add Affiliations and Affiliation Types to docs
Browse files Browse the repository at this point in the history
We added these endpoints for migrations a little while ago.  Bringing
the docs up to date with the new endpoints
  • Loading branch information
NullTerminator committed Mar 20, 2018
1 parent f53d7b3 commit f441a9a
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
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.
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
--------------
Expand Down
68 changes: 68 additions & 0 deletions sections/affiliation_types.md
Original file line number Diff line number Diff line change
@@ -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
<affiliation-type>
<id type="integer">8</id>
<name>Parent</name>
<reciprocal-name>Child</reciprocal-name>
</affiliation>
```

```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
<affiliation-type>
...
</affiliation-type>
```

```json
{
"affiliation_type":
{
"id":the_new_id
...
}
}
```
72 changes: 72 additions & 0 deletions sections/affiliations.md
Original file line number Diff line number Diff line change
@@ -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
<affiliation>
<affiliate-id type="integer">1035</affiliate-id>
<affiliate-type>Contact</affiliate-type>
<affiliator-id type="integer">1044</affiliator-id>
<affiliator-type>Contact</affiliator-type>
<affiliation-type-id type="integer">7</affiliation-type-id>
</affiliation>
```

```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
<affiliation>
...
</affiliation>
```

```json
{
"affiliation":
{
"id":the_new_id
...
}
}
```
51 changes: 51 additions & 0 deletions sections/data_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -977,3 +977,54 @@ Communication JSON
}
```

Affiliation Type XML
----
``` xml
<affiliation-type>
<id type="integer">8</id>
<name>Parent</name>
<reciprocal-name>Child</reciprocal-name>
</affiliation>
```

Affiliation Type JSON
----

``` json
{
"affiliation_type": {
"id":8,
"name":"Parent",
"reciprocal_name":"Child"
}
}
```

Affiliation XML
----
``` xml
<affiliation>
<id type="integer">8</id>
<affiliate-id type="integer">1035</affiliate-id>
<affiliate-type>Contact</affiliate-type>
<affiliator-id type="integer">1044</affiliator-id>
<affiliator-type>Contact</affiliator-type>
<affiliation-type-id type="integer">7</affiliation-type-id>
</affiliation>
```

Affiliation JSON
----

``` json
{
"affiliation": {
"id":8,
"affiliate_id":1035,
"affiliate_type":"Contact",
"affiliator_id":1044,
"affiliator_type":"Contact",
"affiliation_type_id":7
}
}
```

0 comments on commit f441a9a

Please sign in to comment.