Supply Partners API
Creating a Supply Partner
SDK
Use tab completion with SDK to auto-complete function names or show field options!
In [40]: partner = springserve.supply_partners.new({"name": "API Docs partner"}) In [41]: print partner.id, partner.name 1764 API Docs partner
REST API
POST /api/v0/supply_partners
Headers
Content-Type application/json Authorization "yourAuthToken"
Body (example)
{ Â Â "name": "API Docs partner", } |
Required parameters: name
Response
Status code 200
{ 'account_id': 1, 'direct_connect': True, 'id': 1764, 'name': 'API Docs partner', 'optimization_active_default': True, 'optimization_custom_defaults': True, 'optimization_settings_default': { 'lookback_minutes': '30', 'metric': 'Request Fill', 'minimum_requests': '100' } }
Get a Supply Partner
SDK
In [1]: partner = springserve.supply_partners.get(1764) In [2]: print partner.name "API Docs partner"
REST API
GET /api/v0/supply_partners/<id>
Headers
Content-Type application/json Authorization "yourAuthToken"
Response
Status code 200
{ 'account_id': 1, 'direct_connect': True, 'id': 1764, 'name': 'API Docs partner', 'optimization_active_default': True, 'optimization_custom_defaults': True, 'optimization_settings_default': { 'lookback_minutes': '30', 'metric': 'Request Fill', 'minimum_requests': '100' } }
Edit a Supply Partner
SDK
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]: changed.ok Out [4]: True In [5]: print changed.name "I want to change the name"
REST API
PUT /api/v0/supply_partners/<id>
Headers
Content-Type application/json Authorization "yourAuthToken"
Body (example)
{ Â Â Â Â "name" : "I want to change the name" } |
Response
Status code 200
{ 'account_id': 1, 'direct_connect': True, 'id': 1764, 'name': 'I want to change the name', 'optimization_active_default': True, 'optimization_custom_defaults': True, 'optimization_settings_default': { 'lookback_minutes': '30', 'metric': 'Request Fill', 'minimum_requests': '100' } }