Tags are not being assigned using HTTP POST goal in Keap through infusionsoft API

Hi Keap Support,
I have build an API call using Infusionsoft PHP Library, when i am hitting the direct url in the browser then tags are being assigned properly and when i am using that same url in my client campaign HTTP Post then contact is being created but tags are not being assigned.
Here is the API call url.

https://keap.misyte.com/add_user.php?email=john.doe20@example.com&firstname=M

It seems there is some issue from Keap end that i am not sure, kindly assist me with this ASAP as our system is live.

Thanks

We would need to see what API calls your script is making. Would also need to see how you have your HTTP Post setup in the campaign.

Junaid wrote this

if( !empty( $_REQUEST[“email”] ) ){
$add_contact[‘Email’] = $_REQUEST[“email”];
}

if( !empty( $_REQUEST[“firstname”] ) ){
$add_contact[‘FirstName’] = $_REQUEST[“firstname”];
}

if( !empty( $_REQUEST["lastname"] ) ){
    $add_contact['LastName'] = $_REQUEST["lastname"];
}

if( !empty( $_REQUEST["phone"] ) ){
    $add_contact['Phone1'] = $_REQUEST["phone"];
}

$tagids = array(5177,4879, 5189);

	    // Adding contact into IS system
	    $contactid = $infusionsoft->contacts('xml')->add($add_contact);
	    
	    // Applying tags to the new added contact 
	    $contact_service = $infusionsoft->contacts();
	    $contact_service->id = $contactid;
        $contact_service->addTags($tagids);
	    
        // Marking Marketable to send emails
	    $infusionsoft->emails()->optIn($email,'SingleOptIn');

Here are the calls that i am making…

Even i have tried to HTTP Post request with 1 minute delay and tried to put HTTP post right after create deal but result is same.

Sorry, i have posted the wrong url in the description, here is the correct link.

https://keap.misyte.com/add_user_v2.php?email=john.doe30@example.com&firstname=M

FYI: I have crossed verified the link i have just posted and the link i am using in the campaign is same. Only difference is, if you will access above link it will assign 3 tags properly, when we use in HTTP post then tags are not being assigned.

If I had to guess without testing, I would say that since in the browser you are passing a non existent contact to the code it works, creates the contact then tags it. However when doing the HTTP post in the campaign builder, the contact already exists, so when the add contact code runs it does not return a contactid as the contact exists and no new contact needs to be created so the add function does not return one.

Since you are doing a post from infusionsoft you already know the contact id, you can pass the code just that Id instead of email and name, think it is ~Contact.Id~, then you don’t need to run the add code and just tag instead.

Again, just a guess without any testing.