Hi guys!
I'm trying to get all transactional templates to save their IDs but templates method returns empty array. However if I try to get template by Id, It works fine.
Templates method doesn't work even via console using curl, therefore I just provide curl requests.
Returns
{"templates":[]}
Returns
{"id":"d-cd5b73442ffc4e37bdf247abbe8d3095","name":"Test2","generation":"dynamic","updated_at":"2019-07-21 15:10:38","versions":[{"id":"d38d3b8a-faf6-4cef-841e-e8b7fe4e364e","user_id":11514558,"template_id":"d-cd5b73442ffc4e37bdf247abbe8d3095","active":1," .....
......
I'm having the exact same issue.
I'm able to get a template by id: $sendgrid->client->templates()->_($template_id)->get();
However when I try to load all templates: $response = $sendgrid->client->templates()->get();
$response->body():
This is the response body (while statusCode is 200):
"{"templates":[]}"
Hi @tijmenve ,
I've contacted to SendGrid support and they answered that some calls have been changed.
Please try this url - https://api.sendgrid.com/v3/templates?generations=dynamic, it works for me
$queryParams = array('generations' => 'dynamic');
$response = $this->getClient()->templates()->get(null, $queryParams);
Great, this works for me.
Thank you @atsareva!
Hello @atsareva,
Thanks for providing the solution!
With best regards,
Elmer
Most helpful comment
Hi @tijmenve ,
I've contacted to SendGrid support and they answered that some calls have been changed.
Please try this url - https://api.sendgrid.com/v3/templates?generations=dynamic, it works for me