Server

<back to all web services

GetDeviceConsumptionList

Deviceconsumptions
Requires Authentication
The following routes are available for this service:
GET/api/v1/deviceconsumptions
import Foundation
import ServiceStack

public class GetDeviceConsumptionList : IHasBearerToken, Codable
{
    // @ApiMember(IsRequired=true, ParameterType="query")
    public var bearerToken:String

    /**
    * Optional! Follow the format : /api/v1/deviceconsumptions?filter[DeviceGuid]=*
    */
    // @DataMember(Name="filter[DeviceGuid]")
    // @ApiMember(Description="Optional! Follow the format : /api/v1/deviceconsumptions?filter[DeviceGuid]=*", ParameterType="query")
    public var filter_DeviceGuid_:String

    required public init(){}
}

public class GetDeviceConsumptionListResponse : Codable
{
    public var deviceConsumptionList:[DeviceConsumption] = []
    public var responseStatus:ResponseStatus

    required public init(){}
}

// @DataContract
public class DeviceConsumption : Codable
{
    // @DataMember
    public var guid:String

    // @DataMember
    public var deviceReading:Double?

    // @DataMember
    public var deviceReadingDate:Date?

    // @DataMember
    public var deviceReadingKind:DeviceReadingKind

    // @DataMember
    public var changeDate:Date?

    // @DataMember
    public var note:String

    // @DataMember
    public var ampouleColour:String

    // @DataMember
    public var deviceGuid:String

    required public init(){}
}

public enum DeviceReadingKind : String, Codable
{
    case ZA
    case HA
    case MO
    case EB
    case AB
}


Swift GetDeviceConsumptionList 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.

GET /api/v1/deviceconsumptions HTTP/1.1 
Host: beson-servdesk.eras-online.de 
Accept: text/jsv
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
		}
	}
}