API get latest user ID

Discussion in 'Integration' started by nathan_arrowsmith, Sep 11, 2012.

  1. nathan_arrowsmith

    nathan_arrowsmith New Member

    Joined:
    Aug 14, 2012
    Messages:
    1
    I am using the "Add user to aMember via API" code on this page http://www.amember.com/docs/REST_API_examples to add a user. I then need to add product and payment data to this user, using the "Add Invoice, Payment, Access" code on the same page.

    My question is, how do I get the ID of the user that was just added?

    The CURL function outputs this xml to the page, but I can't seem to get at the ID to use it.

    HTML:
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
      <field name="user_id">19</field>
      <field name="login">example</field>
      <field name="email">example@example.com</field>
      <field name="name_f">ex</field>
      <field name="name_l">ample</field>
      <field name="added">2012-09-12 08:58:31</field>
      <field name="remote_addr">127.0.0.1</field>
      <field name="status">0</field>
      <field name="i_agree">0</field>
      <field name="is_approved">1</field>
      <field name="is_locked">0</field>
      <field name="aff_id">1</field>
      <field name="is_affiliate">0</field>
    </row>
    </rows>
    Any suggestions would be appreciated.

Share This Page