Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Creating a Supply Group

REST API

POST /api/v0/supply_groups

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

Body (example)

 

...

{
   "name": "API Docs Group,
}

 

Required parameters: name

Response

Status code 200

Code Block
{
  "id": 353, 
  "name": "API Docs group", 
  "account_id": 1
}

...

SDK

Code Block
In [40]: partner = springserve.supply_groups.new({"name": "API Docs group"})                                                                                                                               

In [41]: print partner.id, partner.name
1764 API Docs group

 

...

REST API

...


GET POST /api/v0/supply_groups/<id>

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

Body (example)


{
   "name": "API Docs Group,
}


Required parameters: name

Response

Status code 200


Code Block
{
  "id": 1764353, 
  "name": "API Docs partnergroup", 
  "account_id": 1
}

...


Get a Supply Group

SDK

Code Block
In [1]: partner = springserve.demand_groups.get(1764)

In [2]: print partner.name

"API Docs partner"

 

...

REST API

PUT GET /api/v0/supply_groups/<id>

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

...

 

{

...

"

...

}

 

Response

Status code 200

Code Block
{
  "id": 3531764, 
  "name": "IAPI want to change the nameDocs partner", 
  "account_id": 1
}

...

Edit a Supply Group

SDK

Code Block
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"

REST API

PUT /api/v0/supply_groups/<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": 353, 
  "name": "I want to change the name", 
  "account_id": 1
}