Booklinker.API

<back to all web services

PutAccountRequest

Requires Authentication
The following routes are available for this service:
PUT/v1/account
import Foundation
import ServiceStack

// @DataContract
public class PutAccountRequest : Codable
{
    // @DataMember(Name="emailAddress")
    public var emailAddress:String

    // @DataMember(Name="fullName")
    public var fullName:String

    // @DataMember(Name="profileImageId")
    public var profileImageId:String

    // @DataMember(Name="signatureImageId")
    public var signatureImageId:String

    // @DataMember(Name="signatureFont")
    public var signatureFont:String

    // @DataMember(Name="signatureAppearance")
    public var signatureAppearance:SignatureAppearance

    required public init(){}
}

public enum SignatureAppearance : String, Codable
{
    case None
    case Text
    case Upload
}

// @DataContract
public class PutAccountResponse : V2BaseResponse
{
    // @DataMember(Name="data")
    public var data:PutAccountResponseData

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

    private enum CodingKeys : String, CodingKey {
        case data
    }

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

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

// @DataContract
public class V2BaseResponse : Codable
{
    // @DataMember(Name="responseStatus")
    public var responseStatus:ResponseStatus

    required public init(){}
}

// @DataContract
public class PutAccountResponseData : Codable
{
    // @DataMember(Name="oneTimeToken")
    public var oneTimeToken:String

    required public init(){}
}


Swift PutAccountRequest 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.

PUT /v1/account HTTP/1.1 
Host: api.booklinker.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"newEmail":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"success":false,"oneTimeToken":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}