1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to call an API after registration

Discussion in 'XenForo Development Discussions' started by janslu, Nov 16, 2015.

  1. janslu

    janslu Member

    What is the best way to make an API call to external service after user confirms registration in Xenforo? I have a custom field for people interested in receiving a newsletter and have an API service to call with their data (I'm sending few fields from registration). In Vbulletin I've had a simple plugin written in PHP registered in register_activate_process localization. Any hints on where to look for inspiration?
     
  2. Daniel Hood

    Daniel Hood Well-Known Member

    I'd say hooking into the user datawriter and executing additional code in the postSave() function (on inserts) would be the best bet.
     
  3. janslu

    janslu Member

    And so the journey begins :) Thank you!
    Do you know of any primers/tutorials? I'm completely lost at the moment, and so far my searches bring more questions than answers. It is possible that I'm asking wrong questions...
     
  4. Daniel Hood

    Daniel Hood Well-Known Member

    I'd recommend looking at the XenForo Class Proxy tutorial by @Jeremy. Use it to extend the load_class_datawriter code event and extend the XenForo_DataWriter_User class. I don't know where you're at as far as php skills so it's hard to give you more direction that that.
     
  5. janslu

    janslu Member

    Many thanks! It's much easier to know where to look for information. I'm moving a large forum from vbulletin to xenforo and there's a lot to learn. You've saved me a lot of time by giving the specific area I need to look into.
     
    Daniel Hood likes this.

Share This Page