0
I have a API
that returns some results, but with your help I managed to make the code work but after a few days the code stopped.
I have this code:
<?php
$email = $_GET['email'];
$nome = $_GET['nome'];
//Não mexer//
require_once "vendor/autoload.php";
use Intercom\IntercomClient;
$client = new IntercomClient('App_ID', 'App_Key');
//Não mexer//
$client->leads->create(["email" => $email]);
sleep(40);
//Pega dados Lead//
$leads = $client->leads->getLeads(['email' => $email]);
foreach($leads->contacts as $contact){
echo "type: " . $contact->type ."<br>";
echo "id: " . $contact->id ."<br>";
echo "user_id: " . $contact->user_id ."<br>";
echo "email: " . $contact->email ."<br>";
echo "name: " . $contact->name ."<br>";
$id = $contact->id;
}
//Termina de Pegar//
//Cria a Tag//
$client->tags->tag([
"name" => "beneficio-em-dobro",
"users" => [
["id" => $id]
]
]);
//end//
As you can see, I have to take a 40-second "break" if the code doesn’t work. I didn’t understand why, if it was working normally.
Response is taking its time, that?
– William Aparecido Brandino
Yeah, at least if I don’t put the 40s it returns a huge error of not Fund etc..
– user50712