Antel API

<back to all web services

GetImage

The following routes are available for this service:
GET/imageReturns the specified image based on the Id.
GET/image/{id}Returns the specified image based on the Id.
<?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};


enum SizeType : int
{
    case Unknown = 0;
    case Full = 1;
    case Small = 2;
    case Medium = 3;
    case Large = 4;
    case XLarge = 5;
}

class GetImage implements JsonSerializable
{
    public function __construct(
        // @ApiMember(DataType="int", IsRequired=true)
        /** @var int */
        public int $id=0,

        /** @description Manually control the server resizing of the image. */
        // @ApiMember(Description="Manually control the server resizing of the image.")
        /** @var SizeType|null */
        public ?SizeType $imageSize=null,

        /** @description Set to true to return the image in Base64 format. */
        // @ApiMember(DataType="boolean", Description="Set to true to return the image in Base64 format.")
        /** @var bool|null */
        public ?bool $base64=null,

        // @ApiMember()
        /** @var string|null */
        public ?string $platform=null,

        /** @description Force this file to be returned as a thumbnail (small) */
        // @ApiMember(Description="Force this file to be returned as a thumbnail (small)")
        /** @var bool|null */
        public ?bool $thumbnail=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['imageSize'])) $this->imageSize = JsonConverters::from('SizeType', $o['imageSize']);
        if (isset($o['base64'])) $this->base64 = $o['base64'];
        if (isset($o['platform'])) $this->platform = $o['platform'];
        if (isset($o['thumbnail'])) $this->thumbnail = $o['thumbnail'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->imageSize)) $o['imageSize'] = JsonConverters::to('SizeType', $this->imageSize);
        if (isset($this->base64)) $o['base64'] = $this->base64;
        if (isset($this->platform)) $o['platform'] = $this->platform;
        if (isset($this->thumbnail)) $o['thumbnail'] = $this->thumbnail;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetImage DTOs

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

HTTP + XML

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

GET /image HTTP/1.1 
Host: antel.api.dev.86degrees.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />