POST oauth/login/users/reset password/email

From Social ID Developers
Jump to: navigation, search

Contents

Description

Sends a reset password email for a user given its username or e-mail.

The reset password email has a default template that allows to configure some properties, such as the sender email, the logo url, a message and the url the user will be redirected to inform the new password.

The redirect_url is the only required parameter (along with email or username) and is used to redirect the user to your site in order to provide reliability to the user inform his new password. You should create the redirect url page with password and confirm password fields, validate the password and confirm password according to your restrictions and call our API to reset the password given the reset password token sent to the redirect url in the query parameter called "token".

The reset password email supports two languages: English (en) and Brazilian Portuguese (pt-br). You can set the language using the HTTP header "Accept-Language".

Resource URL

  POST https://api.socialidnow.com/v2/marketing/login/users/reset_password/email
Note: The old Resource URL has been deprecated but still works
  POST https://api.socialidnow.com/v2/marketing/login/users/reset_password_email

Parameters

JSON Parameters

username 1 optional username.
email_address 1 optional user e-mail.
redirect_url optional the url to redirect the user to inform the new password. Default: the reset password link informed in the custom template.
from optional the sender email
subject optional the email subject
logo_url optional the logo url to display in the email template
description optional an introductory message to the user

1 At least one of these fields must be given to identify the user.

Authentication

This API requires Login App Token authentication. See OAuth.

Language

This API supports language configuration through HTTP "Accept-language" header. The supported languages are:

en English (default)
pt-br Brazilian Portuguese

Response

Response Status

created (201) The email was sent successfully.
bad_request (400) Some required parameter was not informed.
unauthorized (401) The authentication is wrong. See OAuth.
not_found (404) The user was not found.
internal_server_error (500) An unknown error happened.

Examples

Using username and English language

Request

curl -iX POST 'https://api.socialidnow.com/v2/marketing/login/users/reset_password/email' \
-d '{
      "username": "john_doe",
      "redirect_url":"http://www.example.com",
      "from":"contact@example.com",
      "subject":"Example.com - Reset Password",
      "logo_url":"http://www.example.com/logo.png",
      "description":"We received a request to reset your password for Example.com account."
     }' \
-H "Content-type: application/json" \
-H "Accept-language: en" \
-H "Authorization: Bearer 0358172c0cd160dfa731c7a76284fe0c30580f3fc8d827831e9f8b1821d8124c"

Response

Response Headers
HTTP/1.1 201 Created
Status: 201

Using email_address and Brazilian Portuguese language

Request

curl -iX POST 'https://api.socialidnow.com/v2/marketing/login/users/reset_password/email' \
-d '{
      "email_address": "john_doe@domain.com",
      "redirect_url":"http://www.example.com",
      "from":"contact@example.com",
      "subject":"Example.com - Cadastrar Nova Senha",
      "logo_url":"http://www.example.com/logo.png",
      "description":"Nós recebemos uma requisição para recadastrar sua senha em Example.com."
     }' \
-H "Content-type: application/json" \
-H "Accept-language: pt-br" \
-H "Authorization: Bearer 0358172c0cd160dfa731c7a76284fe0c30580f3fc8d827831e9f8b1821d8124c"

Response

Response Headers
HTTP/1.1 201 Created
Status: 201
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox