-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Affiliations and Affiliation Types to docs
We added these endpoints for migrations a little while ago. Bringing the docs up to date with the new endpoints
- Loading branch information
1 parent
f53d7b3
commit f441a9a
Showing
4 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
... | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
... | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters