Server

<back to all web services

PostDeviceConsumption

Deviceconsumptions
Requires Authentication
The following routes are available for this service:
POST/api/v1/deviceconsumptions
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Post;
using Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models;
using Eras2Web.Service.Desktop.Server.ServiceModel.Enums;

namespace Eras2Web.Service.Desktop.Server.ServiceModel.Enums
{
    public enum DeviceReadingKind
    {
        ZA,
        HA,
        MO,
        EB,
        AB,
    }

}

namespace Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models
{
    [DataContract]
    public partial class DeviceConsumption
    {
        [DataMember]
        public virtual Guid Guid { get; set; }

        [DataMember]
        public virtual double? DeviceReading { get; set; }

        [DataMember]
        public virtual DateTime? DeviceReadingDate { get; set; }

        [DataMember]
        public virtual DeviceReadingKind DeviceReadingKind { get; set; }

        [DataMember]
        public virtual DateTime? ChangeDate { get; set; }

        [DataMember]
        public virtual string Note { get; set; }

        [DataMember]
        public virtual string AmpouleColour { get; set; }

        [DataMember]
        public virtual string DeviceGuid { get; set; }
    }

    [DataContract]
    public partial class RelatedTo
    {
        [DataMember]
        public virtual Guid Guid { get; set; }
    }

}

namespace Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Post
{
    public partial class PostDeviceConsumption
        : IHasBearerToken
    {
        [ApiMember(IsRequired=true, ParameterType="body")]
        public virtual DeviceConsumption DeviceConsumption { get; set; }

        [ApiMember(IsRequired=true, ParameterType="body")]
        public virtual RelatedTo RelatedToDevice { get; set; }

        [ApiMember(IsRequired=true, ParameterType="body")]
        public virtual string BearerToken { get; set; }
    }

    public partial class PostDeviceConsumptionResponse
    {
        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual string ChecksumMD5 { get; set; }
    }

}

C# PostDeviceConsumption 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.

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

{"deviceConsumption":{"guid":"00000000000000000000000000000000","deviceReading":0,"deviceReadingDate":"0001-01-01T00:00:00.0000000Z","deviceReadingKind":"ZA","changeDate":"0001-01-01T00:00:00.0000000Z","note":"String","ampouleColour":"String","deviceGuid":"String"},"relatedToDevice":{"guid":"00000000000000000000000000000000"},"bearerToken":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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"}