CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • CiviMail and REST
Pages: [1]

Author Topic: CiviMail and REST  (Read 1317 times)

piotr

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
CiviMail and REST
May 07, 2010, 12:26:01 pm
Hello everybody, that's my first post here.
Is there a way to access Mailer functions (subscribe/unsubscribe/...) through the REST interface?
If I understand well only v2 functions are exported to REST and Mailer API is not there.  :(

Or maybe there is a better way to access those functions from an external website?

piotr

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviMail and REST
May 07, 2010, 03:42:50 pm
If this is about adding a user to a group, you'll need to use the contact create API and the add user to group API (two calls), The group being your newsletter group

Does it answer your question ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

piotr

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: CiviMail and REST
May 10, 2010, 07:32:53 am
Thank you for your answer, but I'm afraid it doesn't answer my question.
Mailer API does much more than just create a contact and add it to a group - all the double opt logic, email confirmations, etc. is there.
But let me change my question a little bit.
/api/Mailer.php is just an adapter to /CRM/Mailing/Event/BAO/*.php functions and is rather simply, is there a reason why it's not converted to v2?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviMail and REST
May 10, 2010, 07:39:45 am
Hi,

Ok, thanks for clarifying, that's indeed different functions.

I don't think there is a better reason that "no one needed it". And the v2 was more focussed on the CRUD first. Would you be up to the task of creating the new api ?

Also, the api v2 tries to get 100% code coverage testing, not rocket science, and a good way of being sure that it does what you want to, and easily spot regressions, would you be willing to try doing that as well ?

X+

P.S. IRC is the right place to discuss about that, you might have questions and so on
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

piotr

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: CiviMail and REST
May 11, 2010, 01:05:46 pm
OK, I probably can do both.

Thanks,
piotr

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviMail and REST
May 13, 2010, 09:17:41 am
Great !

Don't hesitate to come on IRC if you need validation or have questions.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • CiviMail and REST

This forum was archived on 2017-11-26.