I want to use the Fetch plugin (v 1.2.0; Craft Pro 3.3.13) to send messages from a Twig template in some circumstances.
To test the setup, I'm just trying to ping Mandrill, according to the /users/ping.json call: https://mandrillapp.com/api/docs/users.JSON.html#method=ping.
I've tried a bunch of variations, but I keep getting this error:
1 - Server error:
`GET https://mandrillapp.com/api/1.0/users/ping.json`
resulted in a `500 Internal Server Error` response:
{
"status":"error",
"code":-1,
"name":"ValidationError",
"message":"You must specify a key value"
}
According to this answer (admittedly from 2013), "This particular error is common if the JSON is invalid for some reason."
I've looked at Jalen's excellent answer on another Fetch question, but that's for a different API and I'm not sure what to do.
Here's my current code:
{% set client = {
base_uri : 'https://mandrillapp.com/api/1.0/',
timeout : 10
} %}
{% set options = {
key: 'REDACTED',
} %}
{% set destination = 'users/ping.json' %}
{% set request = fetch(client, 'GET', destination, options) %}
I've also tried it with POST, and with various permutations of quotes around the key and api key; same error.