Versions Compared

Key

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

Table of Contents

...

Creating a Demand

...

Label

SDK

Use tab completion with SDK to auto-complete function names or show field options!

Code Block
In [40]: grouplabel = springserve.demand_groupslabels.new({"name": "API Docs grouplabel"})                                                                                                                               

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

REST API

POST /api/v0/demand_groupslabels

Headers

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

Body (example)


{
   "name": "API Docs GroupLabel,
}


Required parameters: name

...

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

...

Get a Demand

...

Label

SDK

Code Block
In [1]: partnerlabel = springserve.demand_partnerslabel.get(1764)

In [2]: print partnerlabel.name

"API Docs partnerlabel"

REST API

GET /api/v0/demand_groupslabels/<id>

Headers

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

...

Code Block
{
  "id": 1764, 
  "name": "API Docs partnerlabel", 
  "account_id": 1
}

Edit a Demand

...

Label

SDK

Code Block
In [1]: partnerlabel = springserve.demand_groupslabels.get(1764)

In [2]: partnerlabel.name = "I want to change the name"

In [3]: changed = partnerlabel.save()

In [4]: changed.ok
Out [4]: True

In [5]: print changed.name

"I want to change the name"

REST API

PUT /api/v0/demand_groupslabels/<id>

Headers

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

...