Snippets

OICP 2.1 Authorize Start | C#

Created by Gregor Schermuly last modified Julius Poessnecker
1
2
3
4
5
6
7
The service description can be found in the OICP 2.1.

Section:
3.1.1 eRoamingAuthorizeStart

To download the latest OICP Version, please visit our website:
https://www.hubject.com/downloads/
/// <summary>
/// Create an OICP v2.0 authorize start request.
/// </summary>
/// <param name="OperatorId">An EVSE operator identification.</param>
/// <param name="AuthToken">A (RFID) user identification.</param>
/// <param name="EVSEId">An optional EVSE identification.</param>
/// <param name="SessionId">An optional session identification.</param>
/// <param name="PartnerProductId">An optional partner product identification.</param>
/// <param name="PartnerSessionId">An optional partner session identification.</param>
/// <param name="QueryTimeout">An optional timeout for this query.</param>
public async Task<HTTPResponse<AUTHSTARTResult>>

    AuthorizeStart(EVSEOperator_Id     OperatorId,
                   Auth_Token          AuthToken,
                   EVSE_Id             EVSEId            = null,
                   ChargingSession_Id  SessionId         = null,
                   ChargingProduct_Id  PartnerProductId  = null,   // [maxlength: 100]
                   ChargingSession_Id  PartnerSessionId  = null,   // [maxlength: 50]
                   TimeSpan?           QueryTimeout      = null)

{ ... }
Task.Factory.StartNew(async () => {

    var AuthStartResult = await new CPOClient("api.playground.hubject.com").
        AuthorizeStart(EVSEOperator_Id.Parse("DE*GEF"),
                       Auth_Token.     Parse("08152305"));

    ConsoleX.WriteLines("AuthStart result:",
                        AuthStartResult.Content.AuthorizationStatus,
                        AuthStartResult.Content.StatusCode.Code,
                        AuthStartResult.Content.StatusCode.Description,
                        AuthStartResult.Content.StatusCode.AdditionalInfo);

}).

// Wait for the task to complete...
Wait();

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.