Versions Compared

Key

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

Table of Contents

...

Code Block
languagepy
themeRDark
router = springserve.supply_routers.new({"name": "Test Router", "supply_partner_id":47340})  
print router.id, router.name

1764 Test Router

REST API

Method: POST POST

Endpoint URL: /api/v0/supply_routers


Parameters:
  • name - (required, type: string) Name of the new supply router.
  • supply_partner_id - (required, type: integer) ID of supply partner to be associated with.

...

Method: GET

Endpoint URL: /api/v0/supply_routers/<id>


Parameters:
  • id - (required, type: integer) ID of the supply router.

...

Code Block
languagejs
themeRDark
var request = require('request');

var options = {
  'method': 'GET',
  'url': 'https://admin-console.springserve.com/api/v0/supply_routers/25528',
  'headers': {
    'Authorization': 'yourAuthToken',
    'Content-Type': 'application/json'
  }
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});


Edit a Supply Router

SDK

Code Block
In [1]: router = springserve.supply_routers.get(1234)

In [2]: router.name = "Test Router with new name"

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


In [4]: changed.ok
Out [4]: True
In [5]: print changed.name

"Test Router with new name"

...

Method: PATCH

Endpoint URL: /api/v0/supply_routers/<id>

Notes - See response for all parameters that can be edited.


Parameters:
  • id - (required, type: integer) ID of the supply router.

...