Booklinker.API

<back to all web services

SignUpRequest

The following routes are available for this service:
POST/v1/signup
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


// @DataContract
class SignUpResponse implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="success")
        /** @var bool|null */
        public ?bool $success=null,

        // @DataMember(Name="hasAccount")
        /** @var bool|null */
        public ?bool $hasAccount=null,

        // @DataMember(Name="accountConfirmed")
        /** @var bool|null */
        public ?bool $accountConfirmed=null,

        // @DataMember(Name="responseStatus")
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['success'])) $this->success = $o['success'];
        if (isset($o['hasAccount'])) $this->hasAccount = $o['hasAccount'];
        if (isset($o['accountConfirmed'])) $this->accountConfirmed = $o['accountConfirmed'];
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->success)) $o['success'] = $this->success;
        if (isset($this->hasAccount)) $o['hasAccount'] = $this->hasAccount;
        if (isset($this->accountConfirmed)) $o['accountConfirmed'] = $this->accountConfirmed;
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class SignUpRequest implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="email")
        // @ApiMember(IsRequired=true, Name="email")
        /** @var string */
        public string $email='',

        // @DataMember(Name="url")
        // @ApiMember(IsRequired=true, Name="url")
        /** @var string */
        public string $url='',

        // @DataMember(Name="domain")
        /** @var string|null */
        public ?string $domain=null,

        // @DataMember(Name="code")
        /** @var string|null */
        public ?string $code=null,

        // @DataMember(Name="affiliateProgramGuid")
        /** @var string */
        public string $affiliateProgramGuid='',

        // @DataMember(Name="affiliateParameters")
        /** @var array<string,string>|null */
        public ?array $affiliateParameters=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['url'])) $this->url = $o['url'];
        if (isset($o['domain'])) $this->domain = $o['domain'];
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['affiliateProgramGuid'])) $this->affiliateProgramGuid = $o['affiliateProgramGuid'];
        if (isset($o['affiliateParameters'])) $this->affiliateParameters = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['affiliateParameters']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->url)) $o['url'] = $this->url;
        if (isset($this->domain)) $o['domain'] = $this->domain;
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->affiliateProgramGuid)) $o['affiliateProgramGuid'] = $this->affiliateProgramGuid;
        if (isset($this->affiliateParameters)) $o['affiliateParameters'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->affiliateParameters);
        return empty($o) ? new class(){} : $o;
    }
}

PHP SignUpRequest DTOs

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

HTTP + JSON

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

POST /v1/signup HTTP/1.1 
Host: api.booklinker.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"email":"String","url":"String","domain":"String","code":"String","affiliateParameters":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

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