07-08-2017 09:04 AM
yes, service status can be added.
/clients/services returns all services, , even if the service has ended
this is intended because someone may want to know about all the services, especially when they were ended or the client was archived, for example to process shaping or suspension.
07-10-2017 02:05 AM
@CC_DKP the proper way how to filter the invoices or any other results of the GET method should be done using the URI parameters (don't use parameters in the BODY). We have updated the API documentation to make it clear:
09-20-2017 10:25 AM
It would be nice to be able to read the management IP for a device (/devices and /devices/id).
Additionally, is there a way to query ip addresses associated with a device interface (/devices/id/device-interfaces or /devices/device-interfaces/id). This query is already present on the web interface (https://ucrm-demo.ubnt.com/interface/XXXX/get-ips-on-device where XXXX is the device_interface id), just not in the api.
I noticed we had accidentally created a few duplicate devices during entry, and I was attempting to use the API to look for duplicates. I eventually had to use device interface MAC address, which unfortunately is not available for all devices. Being able to use management IP would greatly reduce this difficulty (as well as let me identify devices that don't have a management IP set and need updating).
I as many of our customers were added before we had all the device syncing set up correctly, I have noticed some service devices are associated to the wrong towers. I have no way to programatically verify this information. If device_interface IPs were present, I could at least do the same sanity check the web interface does (checking that service_device IP is similar to the IP of the device_interface).
09-21-2017 04:45 AM - edited 09-21-2017 04:45 AM
@CC_DKPcheck out the "status" attribute: http://docs.ucrm.apiary.io/#reference/services/clientsservices/get
4 Prepared blocked
09-22-2017 01:06 AM
I have a question about the API to create a ticket here:
In the comments array, a ticketId is required. Since I am creating a new ticket, I would not have a ticket ID. Could someone please help me to understand this?
10-13-2017 02:14 PM
Can someone point me in the correct direction how I could optain the following:\
Retrieve collection of Service IPs filtered by Service Status.
I want to get a list that contains only service IPs for clients who have a suspended status.
10-19-2017 12:31 AM
Hello @superbree, there is no direct endpoint in the API to do this, it will require a bit of scripting and couple of API endpoints.
First you'll have to get all services with the /clients/services (http://docs.ucrm.apiary.io/#reference/services/clientsservices/get) endpoint.
Then you'll have to manually filter the received array to have only services with the status you want (suspended = 3).
After you have this, you will have to get the service devices for each service ID in the filtered array using the /clients/services/id/service-devices (http://docs.ucrm.apiary.io/#reference/service-devices/clientsservicesservice-devicesid/get) endpoint.
And finally from those, you can get the IP's using the /clients/services/service-devices/id/service-ips (http://docs.ucrm.apiary.io/#reference/service-ips/clientsservicesservice-devicesidservice-ips/get) endpoint.
10-23-2017 06:28 AM
Service IPs appear to be included in the default service list as an array under `ipRanges` element.
The code would only require a single API call to /client/services, then iterate through the response, checking `status` and printing `ipRanges` as appropriate.
03-22-2018 12:32 PM - edited 03-22-2018 01:07 PM
I'm getting "HTTP Error 422: Unprocessable Entity" when trying to update an invoice through the API. Is there an issue with updateing invoices through the API now?
It was because a partial payment had been applied to the invoice. Figured it out.
03-24-2018 11:30 AM
What is the use case for the payment endpoint? If I were to set the method = to 7 (Stripe subscription (credit card)) can I post a cc or stripe token? If so, how?
03-26-2018 07:25 PM
Thank you for clarifying @UBNT-Ondra Would it theoretically be possible to create the charge directly with stripe then use the UCRM api to make a payment and mark it as complete? Or taking it a step further could it be tied with an existing subscription in stripe?
I've been studying the api for the past couple weeks as I've been developing a custom client signup form with scheduling and payment. So I'll keep looking, but input on current api limitations is helpful. I appreciate the help, you guys are providing a great service.
03-27-2018 12:35 AM
@Brandon-W I don't think I understand what you mean by marking the payment as complete or tying it with a subscription. Via UCRM API you can create new Payment entity just for UCRM. You give it all the details you want, most importantly amount, currency and clientId.
If you send the "applyToInvoicesAutomatically" field as true, it will apply itself on all unpaid invoices of the client starting with the oldest one. If you don't want this, you can either send exact IDs of invoices you want it applied to, or just put it in client's credit and then use that credit in UCRM to pay for stuff manually.
Once the payment entity is made, UCRM does not care in any way if it was linked with payment provider (stripe) or not. If it goes through integrated process, the only difference is, that there will be fields like "stripeId", "sourceCardId", "sourceFingerprint", etc. This is not possible via API, however you *can* with API create a payment with method "custom" and fill details like this on your own.
So, basically UCRM does not care if you made payment via Stripe or not, if you do it using your own implementation and then just want to put the payment into UCRM and pay for unpaid invoices, you can do that.
03-27-2018 12:12 PM
That explaination helps, @UBNT-Ondra thank you.
What I meant by 'tying' together is if a subscription exists in stripe can I create a subscription on ucrm that is aware of ongoing payments and when they go through or not.
03-28-2018 12:01 AM
@Brandon-W Thanks for the explanation, no, tying is not possible currently. We are preparing a way for users to implement custom payment providers via UCRM plugins, it might be possible after this is implemented, but I can't promise that yet.
03-28-2018 05:34 AM
I just looked into the plugins, and they do look promising. @UBNT-Ondra
I'd be very interested in developing a plugin that allows for the binding I'm looking for in stripe. Basically I want to be able to have a frontend application (ember in my case) be able to create a stripe subscription that will begin charging the client immediately even before they go into their account because they've already gone through a checkout that creates their client, schedules a job, and selects a service.
If there is need for it I'd be willing to collaborate on whatever is in the works or develop the plugin myself in order to push the feature forward. I'll jump over to the other thread to ask more questions.