2Service Services API

<back to all web services

Authenticate

The following routes are available for this service:
POST/dealers/authenticateAuthenticate with user name and password. Returns session token. Note: the token expires after 5 minutes of inactivity.
"use strict";
export class AuthenticateResult {
    /** @param {{SessionToken?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description Session token to use in successive calls to the services. */
    SessionToken;
}
export class OperationResult {
    /** @param {{IsSuccessful?:boolean,ErrorMessage?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {boolean}
     * @description Specifies if the operation was successful. */
    IsSuccessful;
    /**
     * @type {?string}
     * @description States error message in case of unsuccessful operation. */
    ErrorMessage;
}
export class PartInfoResultImage {
    /** @param {{ImageNumber?:number,ImageUrl?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Image number */
    ImageNumber;
    /**
     * @type {?string}
     * @description Image URL */
    ImageUrl;
}
export class PartStockQuantity {
    /** @param {{LocationId?:number,LocationCode?:string,StockQuantity?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Location ID */
    LocationId;
    /**
     * @type {?string}
     * @description Location code */
    LocationCode;
    /**
     * @type {number}
     * @description Stock quantity in location */
    StockQuantity;
}
export class PartInfoResult {
    /** @param {{Id?:number,PartNumber?:string,Description?:string,Manufacturer?:string,CanBeOrdered?:boolean,StatusText?:string,AvailableStockQuantity?:number,AverageDeliveryInDays?:number,UnitPrice?:number,EanNumber?:string,Images?:PartInfoResultImage[],SecondaryArticleNumbers?:string[],ReplacementArticleNumbers?:string[],StockQuantities?:PartStockQuantity[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Unique ID for the part. */
    Id;
    /**
     * @type {?string}
     * @description Part number. */
    PartNumber;
    /**
     * @type {?string}
     * @description Description of the part. */
    Description;
    /**
     * @type {?string}
     * @description Part manufacturer. */
    Manufacturer;
    /**
     * @type {boolean}
     * @description Determines if the part can be ordered. */
    CanBeOrdered;
    /**
     * @type {?string}
     * @description Textual representation of the status of the part. */
    StatusText;
    /**
     * @type {number}
     * @description Available stock to order. */
    AvailableStockQuantity;
    /**
     * @type {?number}
     * @description Average days needed for delivery. */
    AverageDeliveryInDays;
    /**
     * @type {?number}
     * @description Price of a single unit, excluding VAT. */
    UnitPrice;
    /**
     * @type {?string}
     * @description EAN number. */
    EanNumber;
    /**
     * @type {?PartInfoResultImage[]}
     * @description Images */
    Images;
    /**
     * @type {?string[]}
     * @description Secondary article numbers */
    SecondaryArticleNumbers;
    /**
     * @type {?string[]}
     * @description Replacement article numbers */
    ReplacementArticleNumbers;
    /**
     * @type {?PartStockQuantity[]}
     * @description Stock quantities */
    StockQuantities;
}
export class PartResults {
    /** @param {{TotalNumberOfParts?:number,HasMoreRecords?:boolean,Parts?:PartInfoResult[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Total number of parts available. */
    TotalNumberOfParts;
    /**
     * @type {boolean}
     * @description Indication if there are more parts to retrieve. */
    HasMoreRecords;
    /**
     * @type {?PartInfoResult[]}
     * @description Part records. */
    Parts;
}
/** @typedef T {any} */
export class OperationResult_1 extends OperationResult {
    /** @param {{Result?:PartResults,IsSuccessful?:boolean,ErrorMessage?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {?PartResults}
     * @description Result value */
    Result;
}
export class AuthenticateResponse extends OperationResult_1 {
    /** @param {{Result?:PartResults,IsSuccessful?:boolean,ErrorMessage?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
}
export class Authenticate {
    /** @param {{UserName?:string,Password?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description User name for your account. */
    UserName;
    /**
     * @type {string}
     * @description Password provided by your supplier. */
    Password;
}

JavaScript Authenticate 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 /dealers/authenticate HTTP/1.1 
Host: services.acct.2service.nl 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"UserName":"String","Password":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Result":{"SessionToken":"String"},"IsSuccessful":false,"ErrorMessage":"String"}