LEAF API Documentation
You are in: API » Release 1 » Forgot Password

Issues a new password by email for the user account associated with the given address

Request Password Reset POST

Use the Request Password Reset method to obtain a new password for a use. If the supplied email address matches an existing user account, an email will be sent giving the new password. The action returned gives the outcome of the request: either 'PasswordSent' if successful or 'InvalidEmail', 'NoAccountRegistered' or 'SendFailed' if not.

Parameters

Request Parameters
ParameterNameTypeDescription
emailEmail AddressStringThe address associated with the user account to be reset
Response Parameters
ParameterNameTypeDescription
actionActionEnumeration 

Enumerations

Action (Response)
ValueDescription
PasswordSentNew password was sent
InvalidEmailInvalid email address given
NoAccountRegisteredNo account registered for the email address
SendFailedEmail could not be sent

XML

Request Schema
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="requestreset">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="email" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>The address associated with the user account to be reset</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
Example Request
POST https://api.leaf.eco/r1/forgotpassword.eb HTTP/1.1
Accept: text/xml
Content-Type: text/xml; charset=utf-8

			<?xml version="1.0" encoding="utf-8"?>
<requestreset>
  <email>xsd:string</email>
</requestreset>
Response Schema
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="resetaction">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="action">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="PasswordSent">
                <xsd:annotation>
                  <xsd:documentation>New password was sent</xsd:documentation>
                </xsd:annotation>
              </xsd:enumeration>
              <xsd:enumeration value="InvalidEmail">
                <xsd:annotation>
                  <xsd:documentation>Invalid email address given</xsd:documentation>
                </xsd:annotation>
              </xsd:enumeration>
              <xsd:enumeration value="NoAccountRegistered">
                <xsd:annotation>
                  <xsd:documentation>No account registered for the email address</xsd:documentation>
                </xsd:annotation>
              </xsd:enumeration>
              <xsd:enumeration value="SendFailed">
                <xsd:annotation>
                  <xsd:documentation>Email could not be sent</xsd:documentation>
                </xsd:annotation>
              </xsd:enumeration>
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
Example Response
HTTP/1.1 200 OK
Content-Type: text/xml

<?xml version="1.0" encoding="utf-8"?>
<resetaction>
  <action>xsd:string</action>
</resetaction>

JSON

Example Request
POST https://api.leaf.eco/r1/forgotpassword.eb HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8

			{"email":String}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json

{"action":String}

Status Codes

Status and Error Codes
HTTP StatusError CodeDescription
400DataError:email:RequiredRule

You must provide an email address

Test

The address associated with the user account to be reset