User Tools

Site Tools


api:destination:updatebulk

API : Destination Update bulk

Introduction

This request will update multiple existing destinations.

A destination consists of the prefixes (e.g. +4677 and +4674 for Swedish high-rated numbers) that is the beginning of the number you dial to get to a number in that destination, the country it belongs to, the type of numbers that the destination holds (landline, mobile, special, free) and the connection fee and rates for calling a number in the destination.

This request only updates the prices, and not country code or country name.

Request

URL https://api.telecomx.dk/destination/bulk
Method POST
Access level RESELLLER_ADMIN with FINANCE feature, or ADMIN
Param COUNTRY_CODE 2-Char ISO3166 country code.
Query format Format can either be csv or json, defaults to json.

Format CSV

If format is csv, then the request has to be made as a multipart-form.

Form
File file CSV file containing destinations with their mobile and fixed prices.

Request example file

CountryCode;Country;CustomerFixedFee;CustomerFixedRate;CustomerMobileFee;CustomerMobileRate;ResellerFixedFee;ResellerFixedRate;ResellerMobileFee;ResellerMobileRate;
SE;Sweden;0,5;1,5;0,5;1;0,02;0,5;0,02;0;3
NO;Norway;0,5;1,5;0,5;1;0,02;0,5;0,02;0;3

Format JSON

Body is an array of destinations.

Destination object
_id String 2-Char ISO3166 country code, e.g DK, SE, FR,
fixed Object prices for fixed destinations
fixed.wholesaleFee Number Connection fee for reseller (RESELLER/ADMIN only)
fixed.customerFee Number Connection fee for customer
fixed.wholesaleRate Number Pr. minute rate for reseller (RESELLER/ADMIN only)
fixed.customerRate Number Pr. minute rate for customer
mobile Object prices for mobile destinations
mobile.wholesaleFee Number Connection fee for reseller (RESELLER/ADMIN only)
mobile.customerFee Number Connection fee for customer
mobile.wholesaleRate Number Pr. minute rate for reseller (RESELLER/ADMIN only)
mobile.customerRate Number Pr. minute rate for customer

Request body example

[
  { 
    "_id": "FR",
    "fixed": {
      "customerFee": 0.5,
      "customerRate": 2,
      "wholesaleFee": 0.5,
      "wholesaleRate": 3
    },
    "mobile": {
      "customerFee": 0.5,
      "customerRate": 2,
      "wholesaleFee": 0.5,
      "wholesaleRate": 3
    }
  },
  { 
    "_id": "DE",
    "fixed": {
      "customerFee": 0.5,
      "customerRate": 2.3,
      "wholesaleFee": 0.5,
      "wholesaleRate": 1.8
    },
    "mobile": {
      "customerFee": 0.5,
      "customerRate": 3,
      "wholesaleFee": 0.5,
      "wholesaleRate": 1.2
    }
  }
 
]

Response

{
  "success": true
}

Note that properties holding no value may be omitted from the object.

Errors

Error code Message Description
404 destinations No destinations found in request
404 id Destination not found
422 fixed.wholesaleFee
422 fixed.wholesaleRate Not a valid number
422 fixed.customerFee Not a valid number
422 fixed.customerRate Not a valid number
422 mobile.wholesaleFee Not a valid number
422 mobile.wholesaleRate Not a valid number
422 mobile.customerFee Not a valid number
422 mobile.customerRate Not a valid number
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/destination/updatebulk.txt · Last modified: 2023/10/30 21:14 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki