Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: SlyBaldGuy on January 07, 2017, 04:28:32 PM

Title: Add REST API
Post by: SlyBaldGuy on January 07, 2017, 04:28:32 PM
Origin topic: http://www.simplemachines.org/community/index.php?topic=512386

After implementing this code, what would be the settings in the admin panel to get this code to work?
Title: Re: Add REST API
Post by: dougiefresh on January 08, 2017, 09:54:37 AM
When using this code snippet, there are literally no admin settings to set to make this code work.  In this code snippet, all settings must be hardcoded into Subs-Post.php.  It works only if the Elastic EMail username and API key are set.
Title: Re: Add REST API
Post by: SlyBaldGuy on January 08, 2017, 11:24:17 AM
Thanks Douggie fresh. I implemented the code as suggested and it isn't working, so I wanted to make sure I wasn't missing something on that side.

I'm on  2.0xx. Any suggestions on how to debug this to see why it wouldn't be working?   It looks like Elastic may have updated their API, so I'm wondering if that's the issue.
Title: Re: Add REST API
Post by: d3vcho on January 08, 2017, 11:29:52 AM
Please, for future situations, avoid bumping up such an old topic... It's just better to open a new one. Topic splitted.

Regards :)
Title: Re: Add REST API
Post by: SlyBaldGuy on January 08, 2017, 11:57:09 AM
Quote from: d3vcho on January 08, 2017, 11:29:52 AM
Please, for future situations, avoid bumping up such an old topic... It's just better to open a new one. Topic splitted.

Regards :)

Sorry, with all the information on the old thread I figured it whould be easier to get for people help without jumping between threads.
Title: Re: Add REST API
Post by: dougiefresh on January 09, 2017, 09:01:46 PM
The API URL has changed to https://api.elasticemail.com/v2/email/send.  Changing it to that may assist it in working.  I'm going to assume that you did get an API key and username from the Elastic EMail site, right?  And that you inserted said stuff into the code, correct?
Title: Re: Add REST API
Post by: dougiefresh on January 10, 2017, 10:03:11 PM
Hmmmm.....  I can't get the code to work, either.....  Looking into it.

EDIT: Calling API directly works, but not in the code.  WTF?!
Title: Re: Add REST API
Post by: dougiefresh on January 11, 2017, 09:04:36 PM
Okay, I had to enable SSL support on my localhost PHP service.  I found the information here (http://www.codecheese.com/2012/09/unable-to-find-the-socket-transport-ssl-did-you-forget-to-enable-it-when-you-configured-php/), and once I enabled the SSL support, the code sent the emails just fine....
Title: Re: Add REST API
Post by: dougiefresh on August 02, 2017, 09:38:50 PM
UPDATE:  I've decided to publish the mod, despite the fact the person who said they would pay me $100 for the job hasn't paid, nor has any claim over the mod....

Here it is: Elastic EMail for SMF (http://www.xptsp.com/board/index.php?topic=1604.0).