1Fetch Client API

<back to all web services

Test

The following routes are available for this service:
GET/testSimple test method to confirm the services are working
<?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};


class TestResult implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $WasSuccessful=null,
        /** @var string|null */
        public ?string $Description=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['WasSuccessful'])) $this->WasSuccessful = $o['WasSuccessful'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->WasSuccessful)) $o['WasSuccessful'] = $this->WasSuccessful;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        return empty($o) ? new class(){} : $o;
    }
}

class TestResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Environment=null,
        /** @var array<string,TestResult>|null */
        public ?array $Tests=null,
        /** @var bool|null */
        public ?bool $WasSuccessful=null,
        /** @var string|null */
        public ?string $DB=null,
        /** @var bool|null */
        public ?bool $DebugMode=null,
        /** @var bool|null */
        public ?bool $ServerGC=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Environment'])) $this->Environment = $o['Environment'];
        if (isset($o['Tests'])) $this->Tests = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','TestResult']), $o['Tests']);
        if (isset($o['WasSuccessful'])) $this->WasSuccessful = $o['WasSuccessful'];
        if (isset($o['DB'])) $this->DB = $o['DB'];
        if (isset($o['DebugMode'])) $this->DebugMode = $o['DebugMode'];
        if (isset($o['ServerGC'])) $this->ServerGC = $o['ServerGC'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Environment)) $o['Environment'] = $this->Environment;
        if (isset($this->Tests)) $o['Tests'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','TestResult']), $this->Tests);
        if (isset($this->WasSuccessful)) $o['WasSuccessful'] = $this->WasSuccessful;
        if (isset($this->DB)) $o['DB'] = $this->DB;
        if (isset($this->DebugMode)) $o['DebugMode'] = $this->DebugMode;
        if (isset($this->ServerGC)) $o['ServerGC'] = $this->ServerGC;
        return empty($o) ? new class(){} : $o;
    }
}

class Test implements JsonSerializable
{
    public function __construct(
        /** @description An email address a test email will be sent to */
        // @ApiMember(Description="An email address a test email will be sent to")
        /** @var string|null */
        public ?string $Smtp=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Smtp'])) $this->Smtp = $o['Smtp'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Smtp)) $o['Smtp'] = $this->Smtp;
        return empty($o) ? new class(){} : $o;
    }
}

PHP Test DTOs

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

HTTP + CSV

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

GET /test HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Environment":"String","Tests":{"String":{"WasSuccessful":false,"Description":"String"}},"WasSuccessful":false,"DB":"String","DebugMode":false,"ServerGC":false}