Skip to content

Tag: guzzle

Google Chat API. Can’t create space. Method not found

I’m trying to create a google chat space via making a post request to with Guzzle. In response I’m getting: But if I change the body of the request and add some new invalid fields like this: I’m getting the next response: docs: What’s wrong with my original request? Thanks. Answer The spaces.create documentation explains this at the

Guzzle: Sending POST with Nested JSON to an API

I am trying to hit a POST API Endpoint with Guzzle in PHP (Wordpress CLI) to calculate shipping cost. The route expects a RAW JSON data in the following format: Link to the API I am consuming: I’ve also tried using ‘json’ => $body instead of the ‘body’ parametar. I am getting 400 Bad Request error. Any ideas? Answer

Transforming Twilio library request into Guzzle request

unfortunately our project runs on PHP 7.0 and we cannot upgrade it for now. And Twilio’s library uses PHP 7.2+ on the version that contains the trusthub API support. So I’m trying to do the request “Create EndUser of type: customer_profile_business_information” from this doc page using Guzzle instead of their library, and I’m following instructions from the curl example. Everything

Using Guzzle to retrieve API via (POST), unable to pass JSON parameters for query

I have created an API request, it connects to the server fine and passes basic authentication. The error I receive is “Uncaught GuzzleHttpExceptionClientException: Client error: POST resulted in a 400 Bad Request response: {“code”:400,”result”:”Missing customer id” I have tried many ways to pass the query parameters and none of them have worked. I checked to make sure the JSON

Sentry Transport errors

I’m trying to implement Sentry in our application. I’ve used sentry/sdk but got some errors (probably due to some PHP settings), so I’m now trying to switch the transport method. I removed sentry/sdk from my composer.json file and replaced it with sentry/sentry and php-http/guzzle7-adapter. Please note that in the documentation, they use the guzzle6-adapter, but that gave dependency errors (I