• Prêt à créer votre communauté HubSpot locale ?

    Les responsables HUG organisent des événements, favorisent les rencontres et créent des espaces où les gens peuvent apprendre et évoluer ensemble.

    Devenez un leader HUG

403 attaching a file

psjavi
Participant

Hi,

 

I'm trying to attach a file using the php api integration:

 

"hubspot/api-client": "^10.1.0"

I've the following code:

 

$file = new \SplFileObject($fileObj->getRealPath());
$fileName = $fileObj->getClientOriginalName();

try {
return $this->client->files()->filesApi()->upload($file, null, "/", $fileName, null,
json_encode([
"access" => "PRIVATE",
"ttl" => "P2W",
"overwrite" => false,
"duplicateValidationStrategy" => "NONE",
"duplicateValidationScope" => "EXACT_FOLDER"
])
);
} catch (ApiException $e) {
Log::channel('hubspot')->error('Error al subir archivo:' . PHP_EOL . $e->getMessage(), [
'response' => $e->getResponseBody()
]);
return false;
}

I've the integration permission in alowing the file's handling but I'm getting the following error from Cloudflare Ray / Hubapi.com:

 

psjavi_0-1691155264320.png

 

My app integration permissions:

 

psjavi_1-1691156446339.png

 

0 Votes
5 Réponses 5
Jaycee_Lewis
Leader d'opinion

Hey, @psjavi 👋 That looks like you triggered a block from Clodflare.

 

One question. At the bottom of the error screen, is there a Cloudflare Ray ID? If so, can you DM me the Ray ID and the Portal ID (HubID number) you used when getting this error, please? 

 

Thanks! — Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Votes
psjavi
Participant

Hi @Jaycee_Lewis 

Is this enough for you? This is all that I see in the response.

 

hs_error.jpg

0 Votes
Jaycee_Lewis
Leader d'opinion

Yes. I need you to copy and paste the Ray ID here. In this case, a screenshot won't be enough. 

 

Thanks! —Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Votes
psjavi
Participant

Hi, the Ray ID is: 7f2ecdb41eb52fa1

0 Votes
psjavi
Participant

Hello,

 

I think I have found the reason for the blockage, everything seems to point to the fact that your file storage provider is analysing the documents internally. I mean, the TXT file with which I am testing, has some internal notes with steps to follow to make some configurations in Amazon AWS.

 

It must be analysing the content and it must be finding some instruction as malicious. On the other hand, if I convert the file to PDF, for example, the file uploads correctly.

 

If I try a TXT with a normal paragraph, it attaches it without problems.

 

This is the content of the TXT file:

 

Crear el rol para la instancia y asignárselo a la instancia

Instalar el cliente por shell

dpkg --print-architecture

coger la version de la arquitectura correspondiente

wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

sudo dpkg -i -E ./amazon-cloudwatch-agent.deb

Pasos adicionales recomendados:

sudo mkdir /usr/share/collectd
cd /usr/share/collectd
sudo touch types.db

último paso de subir la config decir No

Inicia el Cloudwatch Agent
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

Revisa el estado del Servicio
sudo systemctl status amazon-cloudwatch-agent

-----

AccederLogsEC2

https://docs.aws.amazon.com/es_es/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.html

https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/

 

0 Votes