Source: medium.com

Consuming the Sonar API

Category: PHP, api

In the first three articles in this series, I walked you through how to use the API using GraphiQL, a web based tool included in Sonar. Using the Sonar GraphQL API in an external application is pretty simple.

As a query and a mutation can both take input data, we use a POST to submit to the server, and receive JSON in response.

I’m going to use Guzzle as my HTTP client in this case.

I personally like to use heredoc syntax to write out my query.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners