I used the following code to get the docusign templstes i already have, however i am always getting the error - failed: SSL certificate problem: unable to get local issuer certificate.
$templateApi = new DocuSign\eSign\Api\TemplatesApi();
$getTemplate = $templateApi->get($accountId, $contract_template_id);
Is my code correct or is it something else that could cause the problem?
I suspect your server is either self certed or is doesn't have SSL/ HHTPS / port 443 setup.
See the StackOverflow issue and Answer here Docusign API call errors PHP
I really suggest using PostMan Client and / or SoapUI to validate you can make the call and see the actual error returned, as it will say more about the most common issues in the response. PostMan or SoapUI will issue the actual API calls successfully (Demo or Prod once you have passed prod API certification) showing you the actual response without having to worry about coding typo's, properties of objects or debugging logging to see what really came back.
This allows you to learn the DocuSign API while using the PHP SDK. You did the right thing asking for help here on Stack Overflow.
I have a couple links for you to get started:
DocuSign Developer Center where you probably found the PHP SDK https://developers.docusign.com/esign-rest-api/sdk-tools
Link for info on PostMan (older version, you can get the latest one - aka Orange Rocket Man logo vs blue world, for Chrome or Mac Standalone - https://blog.grigsbyconsultingllc.com/postman-rest-client-a-google-chrome-app/
X-DocuSign-Authentication Header Q&A on StackOverflow How should the header X-DocuSign-Authentication be used for REST and SOAP?
I like the concept of the DocuSign API explorer to start with, sad part is it doesn't work against prod, so you still have to use something else when you move from demo to prod.
Best of Luck and Enjoy your DocuSign API journey!