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 14 Next »


Creating a Demand Group

SDK

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

In [40]: group = springserve.demand_groups.new({"name": "API Docs group"})                                                                                                                               

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

REST API

POST /api/v0/demand_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
}

Get a Demand Partner

SDK

In [1]: partner = springserve.demand_partners.get(1764)

In [2]: print partner.name

"API Docs partner"

REST API

GET /api/v0/demand_groups/<id>

Headers

Content-Type application/json
Authorization "yourAuthToken"

Response

Status code 200

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

Edit a Demand Partner

SDK

In [1]: partner = springserve.demand_groups.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/demand_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
}
  • No labels