POST api/Login

Sign In using password authentication

Request Information

URI Parameters

None.

Body Parameters

Sign In parameters MUST be passed using regular HTTP Form encoding (e.g. grant_type=value&username=value&password=value); XML and JSON are not supported

SignInModel
NameDescriptionTypeAdditional information
grant_type

Must be the literal string "password"

string

Required

username

The user's email address

string

Required

password

The user's password

string

Required

client_id

An app-defined unique ID for the device/installation

string

Required

scope

Used to control login-related feature availability. Must be a space-separated list of tags. Available tags: allowUnconfirmed

string

None.

Request Formats

application/json, text/json

Sample:
{
  "grant_type": "sample string 1",
  "username": "sample string 2",
  "password": "sample string 3",
  "client_id": "sample string 4",
  "scope": "sample string 5"
}

application/xml, text/xml

Sample:
<SignInModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.API.Models">
  <client_id>sample string 4</client_id>
  <grant_type>sample string 1</grant_type>
  <password>sample string 3</password>
  <scope>sample string 5</scope>
  <username>sample string 2</username>
</SignInModel>

multipart/form-data

Sample:

Failed to generate the sample for media type 'multipart/form-data'. Cannot use formatter 'MultipartMediaTypeFormatter' to write type 'SignInModel'.

Response Information

Resource Description

BearerTokenModel
NameDescriptionTypeAdditional information
access_token

Access token - to be included in API calls requiring authentication Authorization: Bearer {access_token}

string

None.

token_type

token type, will always be the literal string "bearer"

string

None.

expires_in

lifetime in seconds (e.g. 2678400 = 31 days)

integer

None.

refresh_token

Refresh token used to get a new bearer token when this one expires

string

Required

.issued

Date/Time the token was issued (e.g. "Tue, 06 Oct 2015 19:38:34 GMT")

date

None.

.expires

Date/Time the token was issued (e.g. "Tue, 06 Nov 2015 19:38:34 GMT")

date

None.

userId

The user's unique ID

globally unique identifier

None.

email

User's email address

string

None.

first_name

User's first name

string

None.

last_name

user's last name

string

None.

phoneNumber

User's phone number

string

None.

address

The user's address (will be a JSON encoded string)

Address

None.

hasPassword

Whether or not the user has a password

boolean

None.

trialEligible

Whether or not the user is eligible for a trial village

boolean

None.

emailConfirmed

Whether or not the user has confirmed their email address

boolean

None.

systemFeatures

Bit mapped set of enabled system features

VillageFeatures

None.

ssoToken

SSO token to pass to website to get a cookie; expires 1 minute after creation (Call api/Login/SSOToken?clientId={clientId} to get a new one)

string

None.

lastVillageId

Last village the user was on (as far as the server knows)

globally unique identifier

None.

isAdmin

Indicates if user is a Caring Village admin

boolean

None.

isBusinessAdmin

Indicates if user is a Business admin

boolean

None.

Response Formats

application/json, text/json

Sample:
{
  "access_token": null,
  "token_type": "bearer",
  "expires_in": 0,
  "refresh_token": null,
  ".issued": "0001-01-01T00:00:00.000+00:00",
  ".expires": "0001-01-01T00:00:00.000+00:00",
  "userId": "00000000-0000-0000-0000-000000000000",
  "email": null,
  "first_name": null,
  "last_name": null,
  "phoneNumber": null,
  "address": null,
  "hasPassword": false,
  "trialEligible": false,
  "emailConfirmed": false,
  "systemFeatures": 0,
  "ssoToken": null,
  "lastVillageId": "00000000-0000-0000-0000-000000000000",
  "isAdmin": false,
  "isBusinessAdmin": false
}

application/xml, text/xml

Sample:
<BearerTokenModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.API.Models" />