MigrantLeap.Auth

<back to all web services

SimpleRegisterUser

The following routes are available for this service:
POST/api/v1/simpleregister
POST/auth/v1/simpleregister
import Foundation
import ServiceStack

public class SimpleRegisterUser : Codable
{
    public var email:String
    public var language:String
    public var newsLetter:Bool
    public var sid:String
    public var paidSubscription:Bool

    required public init(){}
}

public class SimpleRegisterUserResponse : BaseResponse
{
    public var redirectUrl:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case redirectUrl
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        redirectUrl = try container.decodeIfPresent(String.self, forKey: .redirectUrl)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if redirectUrl != nil { try container.encode(redirectUrl, forKey: .redirectUrl) }
    }
}

public class BaseResponse : Codable
{
    public var responseStatus:ResponseStatus

    required public init(){}
}


Swift SimpleRegisterUser DTOs

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

HTTP + OTHER

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

POST /api/v1/simpleregister HTTP/1.1 
Host: auth.migrantleap.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"email":"String","language":"String","newsLetter":false,"sid":"String","paidSubscription":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"redirectUrl":"String","responseStatus":{"statusCode":0,"message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}