parent
2c49abb49e
commit
1f9e407377
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"_links" : {
|
|
||||||
"ngcp:resellers": {
|
|
||||||
"href": "/api/resellers/?id={id}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"description": "A billing container for a reseller or peering",
|
|
||||||
"required": ["external_id", "status", "type", "billing_profile_id", "contact_id"],
|
|
||||||
"properties": {
|
|
||||||
"status": { "enum": ["active", "locked", "pending", "terminated"], "description": "The operational status of the contract" }
|
|
||||||
"type": { "enum": ["reseller", "sippeering"], "description": "The type of the contract" }
|
|
||||||
"contact_id": { "type": "number", "description": "The ID of the 'ngcp:systemcontacts' item this contract belongs to" },
|
|
||||||
"billing_profile_id": { "type": "number", "description": "The ID of the 'ngcp:billingprofiles' item this contract uses" },
|
|
||||||
"external_id": { "type": ["null", "string"], "description": "An external ID e.g. to identify the contract in a 3rd party system" },
|
|
||||||
},
|
|
||||||
"title": "contract",
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"description": "user preferences for a subscriber",
|
|
||||||
"required": [],
|
|
||||||
"properties": {
|
|
||||||
"attribute": { "type": "string", "description": "The preference name." },
|
|
||||||
"value": { "type": "string", "description": "The preference name." },
|
|
||||||
},
|
|
||||||
"title": "subscriberpreference",
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
|
|
||||||
[% #
|
|
||||||
GET /api/subscriberpreferences/?subscriber_id=10
|
|
||||||
|
|
||||||
[
|
|
||||||
"cli": "12345",
|
|
||||||
"block_in_list": [ "12345", "12346", "12347" ]
|
|
||||||
]
|
|
||||||
|
|
||||||
POST /api/subscriberpreferences/?subscriber_id=10
|
|
||||||
[
|
|
||||||
"cli": "12345",
|
|
||||||
"block_in_list": [ "12345", "12346", "12347" ]
|
|
||||||
]
|
|
||||||
|
|
||||||
GET /api/subscribers/?id=77
|
|
||||||
|
|
||||||
{
|
|
||||||
"username": "foo",
|
|
||||||
|
|
||||||
"_links": [
|
|
||||||
"callforwards": {
|
|
||||||
"href": "/api/callforwards/?subscriber_id=987"
|
|
||||||
},
|
|
||||||
|
|
||||||
"cf_destinationsets": {
|
|
||||||
"href": "/api/destinationsets/?subscriber_id=987"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
GET /api/callforwards/?subscriber_id=77
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
# should be separated by cf types
|
|
||||||
"_links": [
|
|
||||||
"cfu": {
|
|
||||||
"href": "/api/callforwards/?id=555"
|
|
||||||
}
|
|
||||||
"cfb": {
|
|
||||||
"href": "/api/callforwards/?id=556"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
GET /api/callforwards/?id=555
|
|
||||||
|
|
||||||
{
|
|
||||||
"_links": [
|
|
||||||
"destinationset": {
|
|
||||||
"href": "/api/cf_destinationsets/?id=555"
|
|
||||||
},
|
|
||||||
"timeset": {
|
|
||||||
"href": "/api/cf_timesets/?id=556"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GET /api/destinationsets/?subscriber_id=77
|
|
||||||
|
|
||||||
PATCH /api/subscribers/?id=77
|
|
||||||
|
|
||||||
[
|
|
||||||
{ "op":
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
$res = $ua->get("/api/subscribers/?id=77")->from_json;
|
|
||||||
$cf = $res->{_links}->{callforwards}; # "/api/callforwards/?subscriber_id=77
|
|
||||||
$dsets = $res->{_links}->{cf_destinationsets}; # "/api/cf_destinationsets/?subscriber_id=77
|
|
||||||
$res = $ua->get($cf->{href})->from_json;
|
|
||||||
$cfu = $res->{_links}->{cfu}; # /api/callforwards/?id=555
|
|
||||||
if($cfu) {
|
|
||||||
$res = $ua->get($cfu)->from_json;
|
|
||||||
$res = $ua->get($res->{_links}->{collection}->{href})->from_json;
|
|
||||||
$dset = $res->{_links}->{destinationsets}->[0];
|
|
||||||
|
|
||||||
$ua->put($cfu->{href}, "{ \"_links\": [ \"destinationset\": { \"href\": \"$dset->{href}\" }, \"timeset\": null] }");
|
|
||||||
} else {
|
|
||||||
$res = $ua->get($dsets->{href})->from_json;
|
|
||||||
$dset = $res->{_links}->{destinationsets}->[0];
|
|
||||||
|
|
||||||
$ua->put($cf->{href}, "{ \"_links\": [ \"destinationset\": { \"href\": \"$dset->{href}\" }, \"timeset\": null] }");
|
|
||||||
}
|
|
||||||
|
|
||||||
-%]
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"description": "Contact information for a reseller or peering contract",
|
|
||||||
"required": ["city", "company", "country", "email", "firstname", "lastname", "phonenumber", "postcode", "street"],
|
|
||||||
"properties": {
|
|
||||||
"city": { "type": ["null", "string"], "description": "The contact's city." },
|
|
||||||
"company": { "type": ["null", "string"], "description": "The contact's company." },
|
|
||||||
"country": { "type": ["null", "string"], "description": "The contact's country (ISO-3166, e.g. \"AT\" for Austria, \"DE\" for Germany)." },
|
|
||||||
"email": { "type": "string", "format": "email", "description": "The contact's e-mail address." },
|
|
||||||
"firstname": { "type": "string", "description": "The contact's given name." },
|
|
||||||
"lastname": { "type": "string", "description": "The contact's family name." },
|
|
||||||
"phonenumber": { "type": ["null", "string"], "description": "E.164 number. The contact's officephone number." },
|
|
||||||
"postcode": { "type": ["null", "string"], "description": "The contact's postal routing code." },
|
|
||||||
"street": { "type": ["null", "string"], "description": "The contact's street address." }
|
|
||||||
},
|
|
||||||
"title": "systemcontact",
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue