[Spce-user] Bulk import of billing fees via API

Christian Benke benkokakao at gmail.com
Wed May 27 04:35:10 EDT 2015


Andreas,

thanks for the quick answer! I'm running on mr3.8.1, the api.log
doesn't say much:

May 27 10:32:11 ngcp01 ngcp-panel: INFO: IP=192.168.169.126
CALLED=API[POST 201]/api/billingfees/ TX=13E2072F61812530 USER=benke
DATA={ 'purge_existing' => 'true', 'billing_profile_id' => '12'}
MSG="" LOG=""

On 26 May 2015 at 14:45, Andreas Granig <agranig at sipwise.com> wrote:
> Hi,
>
> Well, what's the CE version you're working with, and what does
> /var/log/ngcp/api.log tells you?
>
> Andreas
>
> On 05/26/2015 02:23 PM, Christian Benke wrote:
>> Hello!
>>
>> I'm trying to figure out the correct csv-format to bulk update rates
>> via the API, as defined in the API-documentation [1]. While it got it
>> working fine via the CSV-upload in the webinterface, the same format
>> does not work for the API. I have found several threads defining the
>> format for the webinterface-upload-option (e.g.
>> https://lists.sipwise.com/pipermail/spce-user/2012-July/001708.html),
>> but none that details how the csv has to look like to do a bulk update
>> via the API.
>>
>> Aside from using the same format that works for the
>> webinterface-upload, I also tried to setup the csv-fields in the order
>> given in the API-docs (With billing_zone_id), but that only gives me
>> "Billing Fee successfully uploaded, but skipped the following line
>> numbers: 1":
>>
>> billing_zone_id, destination,direction,offpeak_follow_interval,
>> offpeak_follow_rate,offpeak_init_interval,offpeak_init_rate,onpeak_follow_interval,onpeak_follow_rate,onpeak_init_interval,onpeak_init_rate,purge_existing,source,use_free_time
>> 11637,^9371.+$,out,1,0.187933,1,0.187933,1,0.187933,1,0.187933,true,.,false
>> 10661,^26371.+$,out,1,0.463017,1,0.463017,1,0.463017,1,0.463017,true,.,false
>>
>> (I've also tried true/false for the bool-values, to no avail).
>>
>> Could someone please specify what the correct csv-field-format would
>> be for bulk fees update via the API?
>>
>>
>> [1] "To bulk-upload fees, specify the Content-Type as "text/csv" and
>> POST the CSV in the request body to the collection while specifying
>> the the billing profile via URI parameters, like
>> "/api/billingfees/?billing_profile_id=xx&purge_existing=true""
>>
>> Thanks & best regards,
>> Christian
>> _______________________________________________
>> Spce-user mailing list
>> Spce-user at lists.sipwise.com
>> https://lists.sipwise.com/listinfo/spce-user
>>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user



More information about the Spce-user mailing list