POST login/users/send email confirmation

From Social ID Developers
(Difference between revisions)
Jump to: navigation, search
(JSON Parameters)
 
Line 1: Line 1:
== Description ==
+
#REDIRECT [[POST login/users/email_confirmation/email]]
 
+
Sends an e-mail confirmation for a user given its username or e-mail.
+
 
+
After the call to this API, the user will receive an e-mail with instructions to click on a link and validate his account. Each API call generates a new confirmation token, but only the last one will be valid for confirmation. Furthermore, each call will put the user in an unconfirmed state, so that he will not be able to login until his account is validated. The confirmation token lasts for 24 hours, after this period a new confirmation token must be generated by a new call to this API.
+
 
+
The e-mail has a default template that allows you to configure some properties, such as the sender e-mail, the logo url, a message and the url the user will be redirected after the confirmation.
+
 
+
The redirect_url has two purposes. The first one is to redirect the user to your site after the e-mail confirmation. The other is to receive a HTTP POST to inform you that this user has been confirmed. This request will be encoded in JSON format and will contain the following fields:
+
 
+
{|
+
! align="left" width="200px"  | user_id
+
| The user identifier.
+
|-
+
! align="left" width="200px"  | confirmation_status
+
| A boolean to inform whether the user has been confirmed or not. If the user clicks on the link after it is expired the confirmation_status will be false. Under this situation, a new call must be made to this API which will generate a new e-mail confirmation for the user.
+
|}
+
 
+
<span style="color: red">Security Notice: </span> In the HTTP POST request there is no authentication to ensure that the request was made by us. Therefore, no user information must be present in the response, since an intruder could inform any user_id to retrieve user personal details.
+
 
+
== Resource URL ==
+
 
+
  POST https://api.socialidnow.com/v1/marketing/login/users/send_email_confirmation
+
 
+
== Parameters ==
+
 
+
=== JSON Parameters ===
+
 
+
{|
+
! align="left" width="200px"  | username <sup>1</sup>
+
| width="200px" | optional
+
| username
+
|-
+
! align="left" width="200px"  | email_address <sup>1</sup>
+
| width="200px" | optional
+
| user e-mail
+
|-
+
! align="left" width="200px"  | redirect_url
+
| width="200px" | optional
+
| the url to redirect the user and receive the HTTP POST. Default: the redirect_url argument for the email confirmation link informed in the [https://app.socialidnow.com/marketing/custom_templates custom template].
+
|-
+
! align="left" width="200px"  | from
+
| width="200px" | optional
+
| the sender email. Default: "noreply@coffeebeantech.com".
+
|-
+
! align="left" width="200px"  | subject
+
| width="200px" | optional
+
| the email subject. Default: "Email Address Confirmation".
+
|-
+
! align="left" width="200px"  | logo_url
+
| width="200px" | optional
+
| the logo url to display in the email template. Default: the account's logo.
+
|-
+
! align="left" width="200px"  | description
+
| width="200px" | optional
+
| an introductory message to the user. Default: the description informed in the [https://app.socialidnow.com/marketing/custom_templates custom template].
+
|}
+
 
+
<sup>1</sup> At least one of these fields must be given to identify the user.
+
 
+
== Authentication ==
+
 
+
This API requires Social 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 Status ====
+
{|
+
! align="left" width="200px" | created (200)
+
| The email was sent successfully.
+
|-
+
! align="left" width="200px" | bad_request (400)
+
| Some required parameter was not informed.
+
|-
+
! align="left" width="200px" | unauthorized (401)
+
| The authentication is wrong. See [[Authentication]].
+
|-
+
! align="left" width="200px" | not_found (404)
+
| The user was not found.
+
|-
+
! align="left" width="200px" | 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/send_email_confirmation' \
+
-d '{
+
      "username": "john_doe",
+
      "redirect_url":"http://www.example.com",
+
      "from":"contact@example.com",
+
      "subject":"Example.com - Confirm your Email",
+
      "logo_url":"http://www.example.com/logo.png",
+
      "description":"You should confirm your email to activate your Example.com account."
+
      }' \
+
-H 'Content-type: application/json' \
+
-H 'Accept-language: en' \
+
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
+
 
+
==== Response ====
+
 
+
===== Response Headers =====
+
 
+
HTTP/1.1 200 Ok
+
Status: 200
+
 
+
=== Using email_address and Brazilian Portuguese language ===
+
 
+
==== Request ====
+
 
+
curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/send_email_confirmation' \
+
-d '{
+
      "email_address": "john_doe@domain.com",
+
      "redirect_url":"http://www.example.com",
+
      "from":"contact@example.com",
+
      "subject":"Example.com - Confirmar Email",
+
      "logo_url":"http://www.example.com/logo.png",
+
      "description":"Você precisa confirmar seu email para ativar sua conta em Example.com."
+
      }' \
+
-H 'Content-type: application/json' \
+
-H 'Accept-language: pt-br' \
+
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
+
 
+
==== Response ====
+
 
+
===== Response Headers =====
+
 
+
HTTP/1.1 200 Ok
+
Status: 200
+

Latest revision as of 14:02, 8 July 2020

  1. REDIRECT POST login/users/email_confirmation/email
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox