Server

<back to all web services

PostDeviceConsumption

Deviceconsumptions
Requires Authentication
The following routes are available for this service:
POST/api/v1/deviceconsumptions

export class PostDeviceConsumptionResponse
{
    public responseStatus: ResponseStatus;
    public checksumMD5: string;

    public constructor(init?: Partial<PostDeviceConsumptionResponse>) { (Object as any).assign(this, init); }
}

export enum DeviceReadingKind
{
    ZA = 'ZA',
    HA = 'HA',
    MO = 'MO',
    EB = 'EB',
    AB = 'AB',
}

// @DataContract
export class DeviceConsumption
{
    // @DataMember
    public guid: string;

    // @DataMember
    public deviceReading?: number;

    // @DataMember
    public deviceReadingDate?: string;

    // @DataMember
    public deviceReadingKind: DeviceReadingKind;

    // @DataMember
    public changeDate?: string;

    // @DataMember
    public note: string;

    // @DataMember
    public ampouleColour: string;

    // @DataMember
    public deviceGuid: string;

    public constructor(init?: Partial<DeviceConsumption>) { (Object as any).assign(this, init); }
}

// @DataContract
export class RelatedTo
{
    // @DataMember
    public guid: string;

    public constructor(init?: Partial<RelatedTo>) { (Object as any).assign(this, init); }
}

export class PostDeviceConsumption implements IHasBearerToken
{
    // @ApiMember(IsRequired=true, ParameterType="body")
    public deviceConsumption: DeviceConsumption;

    // @ApiMember(IsRequired=true, ParameterType="body")
    public relatedToDevice: RelatedTo;

    // @ApiMember(IsRequired=true, ParameterType="body")
    public bearerToken: string;

    public constructor(init?: Partial<PostDeviceConsumption>) { (Object as any).assign(this, init); }
}

TypeScript PostDeviceConsumption DTOs

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

HTTP + JSV

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

POST /api/v1/deviceconsumptions HTTP/1.1 
Host: fairtherm-servdesk.eras-online.de 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	deviceConsumption: 
	{
		guid: 00000000000000000000000000000000,
		deviceReading: 0,
		deviceReadingDate: 0001-01-01T00:00:00Z,
		deviceReadingKind: ZA,
		changeDate: 0001-01-01T00:00:00Z,
		note: String,
		ampouleColour: String,
		deviceGuid: String
	},
	relatedToDevice: 
	{
		guid: 00000000000000000000000000000000
	},
	bearerToken: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	checksumMD5: String
}