Reply
Member
Posts: 138
Registered: ‎03-19-2018
Kudos: 23
Solutions: 4

Re: UCRM API

Understood, thank you. @UBNT-Petr
HTML, SCSS, Javascript(Ember.js), Ruby(Ruby on Rails), PHP
New Member
Posts: 36
Registered: ‎12-13-2017
Kudos: 33

Re: UCRM API

Is there a way to change the "Last invoiced date" through the API?

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

@kysevenle this parameter is one of those related to current invoicing status, these cannot be modified with API for now. Do you need to do some kind of batch change for multiple services or is there another important use case?
Member
Posts: 214
Registered: ‎03-09-2009
Kudos: 7

Any way to use API from UCRM to generate invoices into our current billing software?

We already use a good billing software. Is there any way to use API from UCRM to generate invoices into our current billing software?

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: Any way to use API from UCRM to generate invoices into our current billing software?

You can use UCRM API to modify or manage data, invoices etc. in UCRM. You would need 3rd party API to interact with another tool. And of course, you can connect both tools.
New Member
Posts: 38
Registered: ‎05-30-2014
Kudos: 37
Solutions: 5

Re: UCRM API

Is there any method for pulling the Census Block GEOID of a service? If not, could it be added to the Services api call?

When running the FCC report, we ran into issues where some customers didn't have one set, and are now in the process of trying to track down who is missing. If this were exposed, we could easily enumerate the list to find missing entries, or potentially generate our own reports that could integrate with other data outside of UCRM.

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

@CC_DKP you could generate the FCC report to get this data, or am I missing something?
New Member
Posts: 38
Registered: ‎05-30-2014
Kudos: 37
Solutions: 5

Re: UCRM API

@UBNT-Petr We were having issues with the FCC report not whating to generate or being incorrect due to the data being missing or wrong in UCRM (possibly a product of moving the data forward over time from early versions of UCRM).

 

A lot of our API use is writing data integrity reports (making sure everything has a service device with valid interfaces, Distance between CPE and towers are sane, etc.). Being able to pull the Census Block GEOID would allow us to programatically verify it is present, and identify which customers need manual correction.

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

I see, we will most likely add the census block codes to the service API endpoint. However, note that no data missing or disappear due to previous UCRM upgrades. You may just want to check:
- The technology of transmission attribute in all your Service Plans configuration
- Addresses for clients or client's services
New Member
Posts: 39
Registered: ‎08-29-2017
Kudos: 3

Re: UCRM API

Similar to @kysevenle's request, can the Last invoiced date be retrieved?  We have instances where disabling the "Prorated separately" on creating a new service invoiced for current month (prorated), next month and the following month after that.  We only wanted this month (prorated) and next month.  If you don't go back to the service to fix it, they are billed twice.  I need to create an audit report using the API to find out who these customers are.

 

Thank you for a great product and service to the community!  We find UCRM very useful to use with Ubuiqiti products.

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

Hi @jcanady Last invoiced date will be retrievable in 2.14.
as a temporary solution, you could use this query. but be careful, when accessing the UCRM database.

 

sudo docker exec -t ucrm_web_app_1 bash -c 'export PGPASSWORD="${POSTGRES_PASSWORD}" && psql -d "${POSTGRES_DB}" -h "${POSTGRES_HOST}" -p "${POSTGRES_PORT}" -U "${POSTGRES_USER}" -t -c "SELECT client_id, invoicing_last_period_end FROM service"'
New Member
Posts: 2
Registered: ‎01-13-2017

Re: UCRM API

Hi,

 

I saw in the 13.2 patch notes,

 

ADDED

  • API extensions comprising Client Leads.

 

I was wondering if you could tell me the end point for this or when the api documentation will be updated as this is a key feature for us and pulling clients doesn't seem to pull anyone marked as a lead. Thanks!

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255
New Member
Posts: 2
Registered: ‎01-13-2017

Re: UCRM API

[ Edited ]

Hi @UBNT-Petr

 

Edit: we are using 2.13.3


I can create leads using the POST api on clients, I haven't tried updating with patch but when i pull with the get request it is only returning clients and not returning leads. If i change a lead to a client and send the request they show up. Perhaps i'm doing something wrong or maybe there's a bug?

even the array length seems to only match the client list with out leads, i'm using the below url and not using any filters, perhaps that's the issue.

GET -> https://portal.company.com/api/v1.0/clients

 

 

Updated with further testing this evening.

Did some further testing to ensure i'm not crazy Man Happy

 

I created a custom attribute called "islead" and gave it a value of "true" then used the following url to call the API

 

GET -> https://portal.company.com/api/v1.0/clients?customAttributeKey=islead&customAttributeValue=true

 

When the "client" is marked as a lead it does not show but if i uncheck the Client Lead box and do the same query it comes up no problem just that single user, so there seems to either be a new endpoint for leads since the app is able to pull them or there is some sort of bug or something going on.

 

 

UPDATE:

I found a way to get the leads but i'm pretty sure it's not the intended way. let's have a look at the regular API, if UBNT wants to know how i pulled it I PM me and we can discuss that, just didn't want to expose an endpoint that's realistically not ment to be used how i'm using it now.

 

Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

Hi @VulkanX
indeed, it's our fault. The "api/v1.0/clients" endpoint does not involve leads. The fix and further improvements (client/lead filtering) are already done and will be included in the upcoming hotfix release (scheduled for today). Thanks for your help.
Member
Posts: 138
Registered: ‎03-19-2018
Kudos: 23
Solutions: 4

Re: UCRM API

On UCRM 2.13.4 when creating a service plan via api/v2.9/clients/{id}/services

 

I'm getting this error on any period start day above 28. Do I need to account for this when generating client services or is this a bug that can be fixed?

 

 

{
    "code": 422,
    "message": "Validation failed.",
    "errors": {
        "invoicingPeriodStartDay": [
            "The value you selected is not a valid choice."
        ]
    }
}

 

Example of the POST made:

{
  "activeFrom": "2018-08-29T19:36:01+00:00",
  "invoicingStart": "2018-08-29T19:36:01+00:00",
  "invoicingPeriodStartDay": 29,
  "servicePlanId": 3,
  "servicePlanPeriodId": 11
}

 

HTML, SCSS, Javascript(Ember.js), Ruby(Ruby on Rails), PHP
Ubiquiti Employee
Posts: 1,057
Registered: ‎03-21-2016
Kudos: 166
Solutions: 121

Re: UCRM API

@Brandon-W  Hello, this is not a bug. The value can be 1-28 or 31 to indicate the last day of month, same as in service form. We will improve the API docs, thanks for reporting.

New Member
Posts: 10
Registered: 3 weeks ago

Re: UCRM API

How does the new pagination feature work?  I don't see it in the API docs.

Highlighted
Ubiquiti Employee
Posts: 3,276
Registered: ‎12-10-2015
Kudos: 1162
Solutions: 255

Re: UCRM API

@pengdahl so far the pagination for "get clients" endpoint is available only in the latest beta 2.14.0-beta1 https://ucrmbeta.docs.apiary.io/ - see the limit and offset parameters.

This improvement will be added to the next stable release as well in a couple of days. API docs for UCRM stable: https://ucrm.docs.apiary.io/
Regular Member
Posts: 363
Registered: ‎03-13-2008
Kudos: 42
Solutions: 4

Re: UCRM API

Is there a way to alter invoice items via API ? Using PATCH does either nothing (when items is empty, for example) or appends items as new. Will it be possible use DELETE on invoice via API ?

Reply