Highlighted
Emerging Member
Posts: 54
Registered: ‎04-07-2017
Kudos: 42
Solutions: 1

PHP CURL Adding a customer with TAGS via API

PHP curl

 

So I have my online signup working flawlessly, it confirms service availabilty via an api I wrote, goes to stripe for payment, then writes a new client to the ucrm. FOR NOW only in client leads and the script automails us with all the details- couldnt be happier with v1.0... but now its time for v1.1

 

First off, and this issue is holding me back from pretty much all the other things I would eventually like to incorperate. I am sorry if this is confusing but I cant get my head around this (probably because its been ears deep in php for weeks).

 

I want to add a client tag to the newly created account on the same page "new client" or "web signup" whatever. I do not believe we can add this tag to the client in the first creation curl as it needs the account number to set up as next available. 

 

WHICH BRINGS ME TO MY ACTUAL QUESTION

 

Is there an easy way to get this customer id number - all I can think of is pull all of the accounts and get the last number, which inherantly is a bad idea IF 2 people happen to sign up simutaniously. Perhaps I have to pull all accounts and search VIA email or something then find the correct account number that way - but that seems over complicated. Even now I am typing I am thinking I can grab that information from the $response = curl_exec($ch); and may have answered my own question. But out of curiosity how would you guys go about doing this?

 

Thank You as always,

 

Ronn

Emerging Member
Posts: 54
Registered: ‎04-07-2017
Kudos: 42
Solutions: 1

Re: PHP CURL Adding a customer with TAGS via API

[ Edited ]

I actually answered this question in my head while I typed this message and it works. if anyone is interested I just parsed the data from the CURL response.

 

Thanks for the help you guys would have gave me

Member
Posts: 295
Registered: ‎11-18-2009
Kudos: 77
Solutions: 8

Re: PHP CURL Adding a customer with TAGS via API

Exactly, the API returns the newly created (or updated) entity as the response.