SDS P4 API

<back to all web services

StatusV8

Get status

The following routes are available for this service:
GET/api/v5/meteringpoints/{Ean}/statusGet the status of a single asset
GET/api/v8/meteringpoints/{Ean}/statusGet the status of a single asset
import Foundation
import ServiceStack

/**
* Get status
*/
// @Api(Description="Get status")
public class StatusV8 : Generic
{
    /**
    * Request of details of specific metering point with specified ean
    */
    // @ApiMember(DataType="EAN (18 numbers)", Description="Request of details of specific metering point with specified ean", Name="Ean")
    public var ean:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case ean
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        ean = try container.decodeIfPresent(String.self, forKey: .ean)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if ean != nil { try container.encode(ean, forKey: .ean) }
    }
}

public class Generic : Codable
{
    /**
    * Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY
    */
    // @ApiMember(DataType="String", Description="Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY", IsRequired=true, Name="ApiKey")
    public var apiKey:String

    /**
    * Normally the result of the request is put inside a resultobject with some status information about the request. If you want the output as csv this outer object can be irritating. Default value: FALSE 
    */
    // @ApiMember(DataType="Boolean", Description="Normally the result of the request is put inside a resultobject with some status information about the request. If you want the output as csv this outer object can be irritating. Default value: FALSE ", Name="OnlyPayload")
    public var onlyPayload:Bool

    /**
    * Show the request as interpreted by the api. Useful to see how filters / dates are parsed. If no value us provided, the default value is: FALSE 
    */
    // @ApiMember(DataType="Boolean", Description="Show the request as interpreted by the api. Useful to see how filters / dates are parsed. If no value us provided, the default value is: FALSE ", Name="ShowRequest")
    public var showRequest:Bool

    /**
    * Format all DateTime in the response object. If used in browser, sometimes ISO8601 is not correctly transformed. Enum options: ISO8601 (DEFAULT), UTC, NL, NLOffset, Unix, UnixMillis
    */
    // @ApiMember(DataType="Enum", Description="Format all DateTime in the response object. If used in browser, sometimes ISO8601 is not correctly transformed. Enum options: ISO8601 (DEFAULT), UTC, NL, NLOffset, Unix, UnixMillis", Name="DateTimeFormat")
    public var dateTimeFormat:DateTimeFormat

    required public init(){}
}

public enum DateTimeFormat : String, Codable
{
    case ISO8601
    case UTC
    case NL
    case NLOffset
    case IN
    case INOffset
    case Unix
    case UnixMillis
}


Swift StatusV8 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 /api/v5/meteringpoints/{Ean}/status HTTP/1.1 
Host: p4v8.smartdatasolutions.nl 
Accept: text/csv