Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


Creating a Supply 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


{
  "id": 1764, 
  "name": "API Docs partner", 
  "account_id": 1
}

Python Interface

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 /api/v0/supply_partners/<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.supply_partners.get(1764)

In [2]: print partner.name

"API Docs partner"

 

Edit a Supply Partner

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

{
  "id": 1764, 
  "name": "I want to change the name", 
  "account_id": 1
}

Python Interface

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"

  • No labels