on_duplicate parameter issue on add_company method

49 views
Skip to first unread message

Andrei Irimie

unread,
Jun 30, 2016, 3:51:31 AM6/30/16
to CATS API
Hello,

I have a set of companies in my database that should be migrated in CATS via add_company method. The problem is that they have similar informations and names and the API is detectig them as duplicates. Is there a way to use the on_duplicate parameter in a certain way to avoid this? I want everything to be migrated, no matter if they are similar or not.

PS: from the documentation, the most likely to use value is "ignore" for the on_duplicate parameter. but as I see, it returns a standard response with the id of the existing record. Am I getting this wrong or this will not create another company in CATS but return the existing one's id?

Andrei.

Aaron Baluczynski

unread,
Jun 30, 2016, 9:57:01 AM6/30/16
to CATS API
Hi Andrei,

There is no way to entirely skip duplicate checking in API v2. The "ignore" option means that if a duplicate is found, it does not add the new record or update the old. So nothing happens in that case.

But you're in luck, API v3 does not do any duplicate checking by default. I would recommend anyone doing new API integrations use v3.

Aaron

Andrei Irimie

unread,
Jul 1, 2016, 3:30:43 AM7/1/16
to CATS API
We developed this over a few months period and it would be time consuming to switch. I saw that a duplicate checking was removed in the past for someone here: https://groups.google.com/forum/#!topic/cats-api/kWyNQiVk1-s 
Isn't this possible to do right now? Also, on a nother topic: Is there a library for PHP for the v3 of the API.

Aaron Baluczynski

unread,
Jul 1, 2016, 9:56:38 AM7/1/16
to CATS API
We remove duplicate checking from job orders because it didn't make a lot of sense at the API level. Duplicate checking for companies is still useful for most users. Additionally, we're not making any more changes to API v2. All new development is on v3.

Andrei Irimie

unread,
Jul 1, 2016, 10:43:31 AM7/1/16
to CATS API
Ok. Regarding the library question, is there a new library for PHP or we can use the same one?

Aaron Baluczynski

unread,
Jul 1, 2016, 10:49:44 AM7/1/16
to CATS API
At present we don't have any client libraries for API v3. The API has been completely redesigned, follows REST conventions, and is well documented, so it's pretty simple to interact with. I'd suggest using an HTTP library like Guzzle instead of Curl. Take a look at how to create a company, it's pretty easy. Also we have a forum dedicated to v3.

Aaron

Aaron Baluczynski

unread,
Jul 1, 2016, 10:50:19 AM7/1/16
to CATS API
Oh, BTW, you'll need to create a new API key for v3.
Reply all
Reply to author
Forward
0 new messages