"YOUR_API_KEY"]); $promise = $sparky->request('POST', 'templates', [ 'name' => 'PHP example template', 'content' => [ 'from' => 'from@YOUR_DOMAIN', 'subject' => 'Your Subject', 'html' => 'Write your message here.', ], ]); try { $response = $promise->wait(); echo $response->getStatusCode()."\n"; print_r($response->getBody())."\n"; } catch (\Exception $e) { echo $e->getCode()."\n"; echo $e->getMessage()."\n"; }