APIs & Integrations

psjavi
Participant

403 attaching a file

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 Upvotes
5 Replies 5
Jaycee_Lewis
Community Manager
Community Manager

403 attaching a file

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


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
psjavi
Participant

403 attaching a file

Hi @Jaycee_Lewis 

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

 

hs_error.jpg

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

403 attaching a file

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

 

Thanks! —Jaycee


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
psjavi
Participant

403 attaching a file

Hi, the Ray ID is: 7f2ecdb41eb52fa1

0 Upvotes
psjavi
Participant

403 attaching a file

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 Upvotes