POST login/users/reset password/email

From Social ID Developers
(Difference between revisions)
Jump to: navigation, search
(Created page with "== Description == Sends a reset password email for a user given its username or e-mail. == Resource URL == POST https://api.socialidnow.com/v1/marketing/login/users/rese...")
 
 
(17 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
 
Sends a reset password email for a user given its username or e-mail.
 
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 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 [[POST login/users/reset_password|reset the password]] given the reset password token sent to the redirect url in the query parameter called "token".
  
 
== Resource URL ==
 
== Resource URL ==
  
 +
  POST https://api.socialidnow.com/v1/marketing/login/users/reset_password/email
 +
 +
:Note: The old Resource URL has been deprecated but still works
 
   POST https://api.socialidnow.com/v1/marketing/login/users/reset_password_email
 
   POST https://api.socialidnow.com/v1/marketing/login/users/reset_password_email
  
Line 21: Line 28:
 
|-
 
|-
 
! align="left" width="200px"  | redirect_url
 
! align="left" width="200px"  | redirect_url
| width="200px" | required
+
| width="200px" | optional
| the url to redirect the user to inform the new password
+
| the url to redirect the user to inform the new password. Default: the reset password link informed in the [https://app.socialidnow.com/marketing/custom_templates custom template].
 
|-
 
|-
 
! align="left" width="200px"  | from
 
! align="left" width="200px"  | from
 
| width="200px" | optional
 
| width="200px" | optional
| the sender email
+
| the sender email. Default: "noreply@coffeebeantech.com".
 +
|-
 +
! align="left" width="200px"  | subject
 +
| width="200px" | optional
 +
| the email subject. Default: "Reset Password".
 
|-
 
|-
 
! align="left" width="200px"  | logo_url
 
! align="left" width="200px"  | logo_url
 
| width="200px" | optional
 
| width="200px" | optional
| the logo url to display in the email template
+
| the logo url to display in the email template. Default: the account's logo.
 
|-
 
|-
 
! align="left" width="200px"  | description
 
! align="left" width="200px"  | description
 
| width="200px" | optional
 
| width="200px" | optional
| an introductory message to the user
+
| an introductory message to the user. Default: the description informed in the [https://app.socialidnow.com/marketing/custom_templates custom template].
 
|}
 
|}
  
Line 41: Line 52:
 
== Authentication ==
 
== Authentication ==
  
This API requires Social Login App authentication. See [[Authentication]].
+
This API requires Login App authentication. See [[Authentication]].
 +
 
 +
== Language ==
 +
 
 +
This API supports language configuration through HTTP "Accept-language" header. The supported languages are:
 +
 
 +
{|
 +
! align="left" width="200px" | en
 +
| English (default)
 +
|-
 +
! align="left" width="200px" | pt-br
 +
| Brazilian Portuguese
 +
|-
 +
! align="left" width="200px" | it
 +
| Italian
 +
|}
  
 
== Response ==
 
== Response ==
Line 50: Line 76:
 
| The email was sent successfully.
 
| The email was sent successfully.
 
|-
 
|-
! align="left" width="200px" | unprocessable_entity (422)
+
! align="left" width="200px" | bad_request (400)
 
| Some required parameter was not informed.
 
| Some required parameter was not informed.
 
|-
 
|-
Line 62: Line 88:
 
== Examples ==
 
== Examples ==
  
=== Using username ===
+
=== Using username and English language ===
  
 
==== Request ====
 
==== Request ====
  
  curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/reset_password' \
+
  curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/reset_password/email' \
 
  -d '{
 
  -d '{
       "username": "new_user",
+
       "username": "john_doe",
 
       "redirect_url":"http://www.example.com",
 
       "redirect_url":"http://www.example.com",
 
       "from":"contact@example.com",
 
       "from":"contact@example.com",
 +
      "subject":"Example.com - Reset Password",
 
       "logo_url":"http://www.example.com/logo.png",
 
       "logo_url":"http://www.example.com/logo.png",
 
       "description":"We received a request to reset your password for Example.com account."
 
       "description":"We received a request to reset your password for Example.com account."
 
       }' \
 
       }' \
 
  -H 'Content-type: application/json' \
 
  -H 'Content-type: application/json' \
 +
-H 'Accept-language: en' \
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
  
Line 84: Line 112:
 
  Status: 201
 
  Status: 201
  
=== Using email_address ===
+
=== Using email_address and Brazilian Portuguese language ===
  
 
==== Request ====
 
==== Request ====
  
  curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/reset_password' \
+
  curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/reset_password/email' \
 
  -d '{
 
  -d '{
       "email_address": "new_user@user_domain.com",
+
       "email_address": "john_doe@domain.com",
 
       "redirect_url":"http://www.example.com",
 
       "redirect_url":"http://www.example.com",
 
       "from":"contact@example.com",
 
       "from":"contact@example.com",
 +
      "subject":"Example.com - Cadastrar Nova Senha",
 
       "logo_url":"http://www.example.com/logo.png",
 
       "logo_url":"http://www.example.com/logo.png",
       "description":"We received a request to reset your password for Example.com account."
+
       "description":"Nós recebemos uma requisição para recadastrar sua senha em Example.com."
 
       }' \
 
       }' \
 
  -H 'Content-type: application/json' \
 
  -H 'Content-type: application/json' \
 +
-H 'Accept-language: pt-br' \
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
 
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
  

Latest revision as of 16:48, 30 December 2021

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 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".

Resource URL

  POST https://api.socialidnow.com/v1/marketing/login/users/reset_password/email
Note: The old Resource URL has been deprecated but still works
  POST https://api.socialidnow.com/v1/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. Default: "noreply@coffeebeantech.com".
subject optional the email subject. Default: "Reset Password".
logo_url optional the logo url to display in the email template. Default: the account's logo.
description optional an introductory message to the user. Default: the description informed in the custom template.

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

Authentication

This API requires Login App authentication. See Authentication.

Language

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

en English (default)
pt-br Brazilian Portuguese
it Italian

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 Authentication.
internal_server_error (500) An unknown error happened.

Examples

Using username and English language

Request

curl -iX POST 'https://api.socialidnow.com/v1/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' \
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

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/v1/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' \
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

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