PUT,POST | /register |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
/**
* Sign Up
*/
@Api(Description="Sign Up")
@DataContract
open class Register : IPost, IMeta
{
@DataMember(Order=1)
var userName:String? = null
@DataMember(Order=2)
var firstName:String? = null
@DataMember(Order=3)
var lastName:String? = null
@DataMember(Order=4)
var displayName:String? = null
@DataMember(Order=5)
var email:String? = null
@DataMember(Order=6)
var password:String? = null
@DataMember(Order=7)
var confirmPassword:String? = null
@DataMember(Order=8)
var autoLogin:Boolean? = null
@DataMember(Order=10)
var errorView:String? = null
@DataMember(Order=11)
var meta:HashMap<String,String> = HashMap<String,String>()
}
@DataContract
open class RegisterResponse : IMeta, IHasSessionId, IHasBearerToken
{
@DataMember(Order=1)
var userId:String? = null
@DataMember(Order=2)
var sessionId:String? = null
@DataMember(Order=3)
var userName:String? = null
@DataMember(Order=4)
var referrerUrl:String? = null
@DataMember(Order=5)
var bearerToken:String? = null
@DataMember(Order=6)
var refreshToken:String? = null
@DataMember(Order=7)
var refreshTokenExpiry:Date? = null
@DataMember(Order=8)
var roles:ArrayList<String> = ArrayList<String>()
@DataMember(Order=9)
var permissions:ArrayList<String> = ArrayList<String>()
@DataMember(Order=10)
var responseStatus:ResponseStatus? = null
@DataMember(Order=11)
var meta:HashMap<String,String> = HashMap<String,String>()
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /register HTTP/1.1
Host: vue-vite-api.jamstacks.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"userName":"String","firstName":"String","lastName":"String","displayName":"String","email":"String","password":"String","confirmPassword":"String","autoLogin":false,"errorView":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"userId":"String","sessionId":"String","userName":"String","referrerUrl":"String","bearerToken":"String","refreshToken":"String","refreshTokenExpiry":"\/Date(-62135596800000-0000)\/","roles":["String"],"permissions":["String"],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"meta":{"String":"String"}}