api_auth

<back to all web services

LoginRequest

The following routes are available for this service:
POST/api/loginCreates a session between user and bit.pub web site
LoginRequest Parameters:
NameParameterData TypeRequiredDescription
EmailbodystringNoEmail user has registered with. Either email or telephone is required.
TelephonebodystringNoTelephone number user has registered with. Either email or telephone is required.
PasswordbodystringYesPassword user has registered with.
RememberForbodystringNoPeriod to maintain a session between user and bit.pub web site. If not present - session with expire when user closes browser OR in 8 hours, whatever comes first. If present, this field should contain a number followed by min|hour|day|week|month|year (no spaces).
NoCookiesbodyboolNoSet this flag if user has cookies disabled in browser. Session id will be sent in response then.
UserInfo Parameters:
NameParameterData TypeRequiredDescription
PersonIDformlongNo
NameformstringNo
EmailformstringNo
Telephoneformlong?No
HyperIDformstringNo
IsConfirmedformboolNo
IsEmailConfirmedformboolNo
IsTelephoneConfirmedformboolNo
IsAddressConfirmedformboolNo
IsPassportConfirmedformboolNo
DatacenterIDformbyteNo
SessionIDformlongNo
MailNodeIDformint?No
CanResendConfirmationformboolNo
LanguageformstringNo
ServerTimeformDateTimeNo
ExpirationTimeformDateTimeNoExpiration time of current session
UserAgentformUserAgentInfoNo
SessionKeyformstringNo
MinAuthLevelformintNo
SessionAuthLevelformintNo
UserAgentInfo Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
DeviceNameformstringNo
DeviceTypeformshortNo
OSTypeformshortNo
OSVersionformstringNo
BrowserNameformstringNo
BrowserVersionformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/login HTTP/1.1 
Host: 1.hyper.id 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	email: String,
	telephone: String,
	password: String,
	rememberFor: String,
	noCookies: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	personID: 0,
	name: String,
	email: String,
	telephone: 0,
	hyperID: String,
	isConfirmed: False,
	isEmailConfirmed: False,
	isTelephoneConfirmed: False,
	isAddressConfirmed: False,
	isPassportConfirmed: False,
	datacenterID: 0,
	sessionID: 0,
	mailNodeID: 0,
	canResendConfirmation: False,
	language: String,
	userAgent: 
	{
		name: String,
		deviceName: String,
		deviceType: 0,
		osType: 0,
		osVersion: String,
		browserName: String,
		browserVersion: String
	},
	sessionKey: String,
	minAuthLevel: 0,
	sessionAuthLevel: 0
}