[Spce-user] generare invoices all months

Irina Peshinskaya ipeshinskaya at sipwise.com
Thu Mar 15 03:08:15 EDT 2018


Dear David,

Files contain 404 responses from your server.
To investigate further, could you please also send full curl command (& 
output) that you used to create invoice and download it?

Like this:

    root at sp1:~# curl -i -X POST -H 'Connection: close' -H 'Content-Type:
    application/json' --user administrator:pwd -k
    'https://127.0.0.1:1443/api/invoices/' --data-binary '{
    "customer_id" : "209", "template_id" : "1", "period_start":
    "2018-03-01 00:00:00", "period_end": "2018-03-31 23:59:59"  }'
    HTTP/1.1 201 Created
    Server: nginx
    Date: Thu, 15 Mar 2018 06:59:17 GMT
    Content-Length: 0
    Connection: close
    Location: /api/invoices/3
    Set-Cookie:
    ngcp_panel_session=f6327544c9b771feac45d52f00dd0c2de0589ff0; path=/;
    expires=Thu, 15-Mar-2018 07:59:16 GMT; HttpOnly
    X-Catalyst: 5.90114
    Strict-Transport-Security: max-age=15768000

You can see above that response header "Location" contains information 
about newly generated invoice id and relative path. So you can use it to 
download generated invoice.


    root at sp1:~# curl -i -X GET -H 'Connection: close' -H 'Accept:
    application/pdf' --user administrator:administrator -k
    'https://127.0.0.1:1443/api/invoices/3' > /tmp/invoice_3.pdf

    root at sp1:~# ls -l /tmp/invoice_3.pdf
    -rwxrwx--- 1 root vboxsf 42005 Mar 15 07:59 /tmp/invoice_3.pdf

Size of the downloaded file should be something around 30Kb-50Kb
.

On 2018-03-14 22:47, David | csr-online SPAIN wrote:
> I generate this attached
>
>
> -----Mensaje original-----
> De: Irina Peshinskaya [mailto:ipeshinskaya at sipwise.com]
> Enviado el: miércoles, 14 de marzo de 2018 22:45
> Para: David | csr-online SPAIN <davidp at csr-online.net>
> CC: spce-user at lists.sipwise.com
> Asunto: Re: [Spce-user] generare invoices all months
>
> Dear David,
>
> Could you please send me your downloaded file that is not opened in the adobe reader?
> Later I maybe will ask for usual ngcp-panel logs.
>
> Thanks in advance.
>
> Best regards,
> Irina Peshinskaya
>
> On 2018-03-14 22:38, David | csr-online SPAIN wrote:
>> Hello i run this line but the pdf download is unreadable by the adobe
>> reader If I check de url via browser don’t return the pdf
>>
>>>>
>>
>> De: Irina Peshinskaya <ipeshinskaya at sipwise.com>
>> Fecha: miércoles, 14 de marzo de 2018, 8:10
>> Para: David Pablo <davidp at csr-online.net>
>> CC: "spce-user at lists.sipwise.com" <spce-user at lists.sipwise.com>
>> Asunto: Re: [Spce-user] generare invoices all months
>>
>> Dear David,
>>
>> Regarding invoice saved to some directory. You can download generated invoice pdf and save it to the directory:
>> curl -i -X GET -H 'Connection: close' -H 'Accept: application/pdf'
>> --user administrator:pwd -k 'https://127.0.0.1:1443/api/invoices/1' > /tmp/invoice_1.pdf About your other question:
>>
>> One question, is possible to group calls by subscriber to have better
>> costs report
>>
>> ????
>> No, now it is not implemented that way. Calls are shown chronologically.
>>
>> Best regards,
>> Irina Peshinskaya
>>
>>
>> On 2018-03-13 14:43, David | csr-online SPAIN wrote:
>>
>> Is possible to send invoice to a folder?
>>
>>
>>
>> writing on the go
>>
>>
>>
>> El 13 mar 2018, a las 14:36, Irina Peshinskaya <ipeshinskaya at sipwise.com<mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com>> escribi?:
>>
>>
>>
>> Dear David,
>>
>> I need to make some "script" that create invoice for all customers and put invoices in a directory?
>>
>> Yes, your supposition is correct and further automation need to be done on your side.
>>
>>
>>
>> Best regards,
>>
>> Irina
>>
>>
>>
>> On 2018-03-13 13:18, David | csr-online SPAIN wrote:
>>
>>
>>
>> Its works one question please.
>>
>>
>>
>> Is possible to make this every month for all customers? Or I need tu make one line for every customer???
>>
>> Are the invoices possible to put all in one folder?
>>
>>
>>
>> I need to make some "script" that create invoice for all customers and put invoices in a directory?
>>
>>
>>
>> Than you very much
>>
>>
>>
>>
>>
>> ?El 13/3/18 12:41, "Irina Peshinskaya" <ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com> escribi?:
>>
>>
>>
>>       Dear David,
>>
>>
>>
>>       Could you please write full curl command (without credentials)
>> that
>>
>>       produces such error for you?
>>
>>
>>
>>       Also please send me your log files:
>>
>>       /var/log/ngcp/api.log
>>
>>       /var/log/ngcp/panel.log
>>
>>       /var/log/ngcp/panel-debug.log
>>
>>
>>
>>       Best regards,
>>
>>       Irina Peshinskaya
>>
>>
>>
>>       On 2018-03-13 11:13, David | csr-online SPAIN wrote:
>>
>>       > Thank you i send this:
>>
>>       >
>>
>>       > https://sbc1eu.csr-online.net:1443/api/invoices/' --data-binary '{ "customer_id" : "5", "template_id" : "3", "period_start": "2018-02-01 00:00:00", "period_end": "2018-02-30 23:59:59"  }'
>>
>>       >
>>
>>       > always I receive: {"message":"Invalid id in request
>> URI","code":"400"}
>>
>>       >
>>
>>       > I have customer 5 and template 3
>>
>>       >
>>
>>       > ???? any idea?
>>
>>       > thanks
>>
>>       >
>>
>>       > El 13/3/18 11:01, "Irina Peshinskaya" <ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com><mailto:ipeshinskaya at sipwise.com> escribi?:
>>
>>       >
>>
>>       >      Dear David,
>>
>>       >
>>
>>       >      In the ngcp-panel 5.5.1 you can use POST method in the /api/invoices
>>
>>       >      REST interface.
>>
>>       >
>>
>>       >      curl -i -X POST -H 'Connection: close' -H 'Content-Type:
>>
>>       >      application/json' --user administrator:pwd -k
>>
>>       >      'https://127.0.0.1:1443/api/invoices/' --data-binary '{ "customer_id" :
>>
>>       >      "15", "template_id" : "1", "period_start": "2017-11-01 00:00:00",
>>
>>       >      "period_end": "2017-11-30 23:59:59"  }'
>>
>>       >
>>
>>       >      Best regards,
>>
>>       >      Irina Peshinskaya
>>
>>       >
>>
>>       >      On 2018-03-13 10:39, David | csr-online SPAIN wrote:
>>
>>       >      > Hello i use version 5.5.1 and i see the gen invoice is disbaled by default because can damage the databse.
>>
>>       >      > How I can create every month all invoices for my customers? Not manually
>>
>>       >      >
>>
>>       >      > Any help please?
>>
>>       >      >
>>
>>       >      >
>>
>>       >      >
>>
>>       >      > Cordialment | Atentamente | Sincerely
>>
>>       >      > David Pablo Mitchell
>>
>>       >      > CTO
>>
>>       >      >
>>
>>       >      > CSR ONLINE
>>
>>       >      > Movil: +34 658174990
>>
>>       >      > Tel.Oficina:+34 931860160 / +34 902056355 ext.101
>>
>>       >      > Mail: davidp at csr-online.net<mailto:davidp at csr-online.net><mailto:davidp at csr-online.net><mailto:davidp at csr-online.net>
>>
>>       >      > Web: www.csr-online.net<http://www.csr-online.net><http://www.csr-online.net><http://www.csr-online.net>
>>
>>       >      > You run your business, we run your IT.
>>
>>       >      >
>>
>>       >      >
>>
>>       >      > La informaci?n contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y est? destinada a ser le?da s?lo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario se?alado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicaci?n por error, le informamos que est? totalmente prohibida, y puede ser ilegal, cualquier divulgaci?n, distribuci?n o reproducci?n de esta comunicaci?n, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direcci?n arriba mencionada.
>>
>>       >      > _______________________________________________
>>
>>       >      > Spce-user mailing list
>>
>>       >      > Spce-user at lists.sipwise.com<mailto:Spce-user at lists.sipwise.com><mailto:Spce-user at lists.sipwise.com><mailto:Spce-user at lists.sipwise.com>
>>
>>       >      > https://lists.sipwise.com/listinfo/spce-user
>>
>>       >
>>
>>       >
>>
>>       >
>>
>>       >
>>
>>       > Cordialment | Atentamente | Sincerely
>>
>>       > David Pablo Mitchell
>>
>>       > CTO
>>
>>       >
>>
>>       > CSR ONLINE
>>
>>       > Movil: +34 658174990
>>
>>       > Tel.Oficina:+34 931860160 / +34 902056355  ext.101
>>
>>       > Mail:
>> davidp at csr-online.net<mailto:davidp at csr-online.net><mailto:davidp at csr-
>> online.net><mailto:davidp at csr-online.net>
>>
>>       > Web:
>> www.csr-online.net<http://www.csr-online.net><http://www.csr-online.ne
>> t><http://www.csr-online.net>
>>
>>       > You run your business, we run your IT.
>>
>>       >
>>
>>       >
>>
>>       > La informaci?n contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y est? destinada a ser le?da s?lo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario se?alado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicaci?n por error, le informamos que est? totalmente prohibida, y puede ser ilegal, cualquier divulgaci?n, distribuci?n o reproducci?n de esta comunicaci?n, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direcci?n arriba mencionada.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Cordialment | Atentamente | Sincerely
>>
>> David Pablo Mitchell
>>
>> CTO
>>
>>
>>
>> CSR ONLINE
>>
>> Movil: +34 658174990
>>
>> Tel.Oficina:+34 931860160 / +34 902056355  ext.101
>>
>> Mail:
>> davidp at csr-online.net<mailto:davidp at csr-online.net><mailto:davidp at csr-
>> online.net><mailto:davidp at csr-online.net>
>>
>> Web:
>> www.csr-online.net<http://www.csr-online.net><http://www.csr-online.ne
>> t><http://www.csr-online.net>
>>
>> You run your business, we run your IT.
>>
>>
>>
>>
>>
>> La informaci?n contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y est? destinada a ser le?da s?lo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario se?alado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicaci?n por error, le informamos que est? totalmente prohibida, y puede ser ilegal, cualquier divulgaci?n, distribuci?n o reproducci?n de esta comunicaci?n, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direcci?n arriba mencionada.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Cordialment | Atentamente | Sincerely
>>
>> David Pablo Mitchell
>>
>> CTO
>>
>>
>>
>> CSR ONLINE
>>
>> Movil: +34 658174990
>>
>> Tel.Oficina:+34 931860160 / +34 902056355 ext.101
>>
>> Mail: davidp at csr-online.net<mailto:davidp at csr-online.net>
>>
>> Web: www.csr-online.net<http://www.csr-online.net>
>>
>> You run your business, we run your IT.
>>
>>
>>
>>
>>
>> La informaci?n contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y est? destinada a ser le?da s?lo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario se?alado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicaci?n por error, le informamos que est? totalmente prohibida, y puede ser ilegal, cualquier divulgaci?n, distribuci?n o reproducci?n de esta comunicaci?n, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direcci?n arriba mencionada.
>>
>>
>>
>>
>> Cordialment | Atentamente | Sincerely
>> David Pablo Mitchell
>> CTO
>>
>> CSR ONLINE
>> Movil: +34 658174990
>> Tel.Oficina:+34 931860160 / +34 902056355 ext.101
>> Mail: davidp at csr-online.net
>> Web: www.csr-online.net
>> You run your business, we run your IT.
>>
>>
>> La información contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y está destinada a ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibida, y puede ser ilegal, cualquier divulgación, distribución o reproducción de esta comunicación, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la dirección arriba mencionada.
>
> Cordialment | Atentamente | Sincerely
> David Pablo Mitchell
> CTO
>
> CSR ONLINE
> Movil: +34 658174990
> Tel.Oficina:+34 931860160 / +34 902056355  ext.101
> Mail: davidp at csr-online.net
> Web: www.csr-online.net
> You run your business, we run your IT.
>
>
> La información contenida en el mensaje y/o archivo(s) adjunto(s) es confidencial y está destinada a ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibida, y puede ser ilegal, cualquier divulgación, distribución o reproducción de esta comunicación, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la dirección arriba mencionada.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/mailman/private/spce-user_lists.sipwise.com/attachments/20180315/07f844ec/attachment.html>


More information about the Spce-user mailing list