Creating a Supply Group
REST API
POST /api/v0/supply_groups
Headers
Content-Type application/json Authorization "yourAuthToken"
Body (example)
{ "name": "API Docs Group, } |
Required parameters: name
Response
Status code 200
{ "id": 353, "name": "API Docs group", "account_id": 1 }
Python Interface
In [40]: partner = springserve.supply_groups.new({"name": "API Docs group"}) In [41]: print partner.id, partner.name 1764 API Docs group
Get a Supply Group
REST API:
GET /api/v0/supply_groups/<id>
Headers
Content-Type application/json Authorization "yourAuthToken"
Response
Status code 200
{ "id": 1764, "name": "API Docs partner", "account_id": 1 }
Python Interface
In [1]: partner = springserve.demand_groups.get(1764) In [2]: print partner.name "API Docs partner"
Edit a Supply Group
REST API
PUT /api/v0/supply_groups/<id>
Headers
Content-Type application/json Authorization "yourAuthToken"
Body (example)
{ "name" : "I want to change the name" } |
Response
Status code 200
{ "id": 353, "name": "I want to change the name", "account_id": 1 }
Python Interface
In [1]: partner = springserve.supply_groups.get(353) 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"