How to use Single Send API in PHP Application Form Submission
I need to send order confirmation details and etc email formats to the customer using the transitional email(Single Send API or others). How I need to parse the custom values to the API.
Already created email template too.
It have only for JSON, Can you provide me any document for PHP
Before I tried with https also but now its working. But I am getting below error.
`curl Errors: Status code: 400 Response: {"status":"error","message":"Mismatch in custom properties between template and request.\n - Custom properties in the template, but not in the request: firstname, current_year, location_summary, ordernumber, pickupdate, forecast, location","correlationId":"a21ed56b-7a88-4420-83bd-fcc564dcc3df","sendResult":"MISSING_TEMPLATE_PROPERTIES","requestId":"79f9621e2a0ed45af1e72e411196bf87"}`
But I passed all the values to the API. Please review my above code.
After looking a bit more closely, it looks like the protocol of the URL you specified in $endpoint is http instead of https. That might possibly be the issue, since the HubSpot APIs all require https.
That error has a space before the protocol (i.e. " https" instead of "https"). Is it possible that you have an extra space in there somewhere? That error commonly appears when the protocol is mistyped:
Please check my code, there is no space in before or after "https" and I tried with "http" also. Same curl execution working for other API, but its not working for the Single Send API. I hope someone will guide me on this, who is well known of PHP.
I'm not particularly familiar with PHP, but no matter what language you use the data sent to the single send API must be properly formatted JSON. Below is some documentation on the built-in JSON methods, but I'm sure there are also a number of libraries that effectively handle JSON data:
How to use Single Send API in PHP Application Form Submission
Hi Derek,
Thanks for the reply. I created new template on my account and need to send multiple custom values to the api. Can you review below PHP code(whom well know PHP).