...
Creating a Supply Partner
REST API
POST /api/v0/supply_partners
Headers
Code Block |
---|
Content-Type application/json
Authorization "yourAuthToken" |
...
...
{
"name": "API Docs partner",
}
Required parameters: name
Response
Status code 200
Code Block |
---|
{
"id": 1764,
"name": "API Docs partner",
"account_id": 1
}
|
...
SDK
Code Block |
---|
In [40]: partner = springserve.supply_partners.new({"name": "API Docs partner"})
In [41]: print partner.id, partner.name
1764 API Docs partner
|
...
Get a Supply Partner
REST API
...
GET POST /api/v0/supply_partners/<id>
Headers
Code Block |
---|
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "name": "API Docs partner", } |
Required parameters: name
Response
Status code 200
Code Block |
---|
{ "id": 1764, "name": "API Docs partner", "account_id": 1 } |
...
...
Get a Supply Partner
SDK
Code Block |
---|
In [1]: partner = springserve.supply_partners.get(1764) In [2]: print partner.name "API Docs partner" |
Edit a Supply Partner
REST API
PUT GET /api/v0/supply_partners/<id>
Headers
Code Block |
---|
Content-Type application/json
Authorization "yourAuthToken" |
...
{
...
" |
...
}
Response
Status code 200
Code Block |
---|
{ "id": 1764, "name": "IAPI want to change the nameDocs partner", "account_id": 1 } |
...
Edit a Supply Partner
SDK
Code Block |
---|
In [1]: partner = springserve.supply_partners.get(1764) In [2]: partner.name = "I want to change the name" In [3]: changed = partner.save() In [4]: print changed.name "I want to change the name" |
REST API
PUT /api/v0/supply_partners/<id>
Headers
Code Block |
---|
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "name" : "I want to change the name" } |
Response
Status code 200
Code Block |
---|
{
"id": 1764,
"name": "I want to change the name",
"account_id": 1
} |