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.
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports _2Service.Webservices.ServiceModel.Dealers
Imports _2Service.Webservices.ServiceModel

Namespace Global

    Namespace _2Service.Webservices.ServiceModel

        Public Partial Class OperationResult
            '''<Summary>
            '''Specifies if the operation was successful.
            '''</Summary>
            <ApiMember(Description:="Specifies if the operation was successful.", ParameterType:="model")>
            Public Overridable Property IsSuccessful As Boolean

            '''<Summary>
            '''States error message in case of unsuccessful operation.
            '''</Summary>
            <ApiMember(Description:="States error message in case of unsuccessful operation.", ParameterType:="model")>
            Public Overridable Property ErrorMessage As String
        End Class

        Public Partial Class OperationResult(Of T)
            Inherits OperationResult
            '''<Summary>
            '''Result value
            '''</Summary>
            <ApiMember(Description:="Result value", ParameterType:="model")>
            Public Overridable Property Result As PartResults
        End Class
    End Namespace

    Namespace _2Service.Webservices.ServiceModel.Dealers

        Public Partial Class Authenticate
            '''<Summary>
            '''User name for your account.
            '''</Summary>
            <ApiMember(Description:="User name for your account.", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property UserName As String

            '''<Summary>
            '''Password provided by your supplier.
            '''</Summary>
            <ApiMember(Description:="Password provided by your supplier.", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property Password As String
        End Class

        Public Partial Class AuthenticateResponse
            Inherits OperationResult(Of AuthenticateResult)
        End Class

        Public Partial Class AuthenticateResult
            '''<Summary>
            '''Session token to use in successive calls to the services.
            '''</Summary>
            <ApiMember(Description:="Session token to use in successive calls to the services.", ParameterType:="model")>
            Public Overridable Property SessionToken As String
        End Class

        Public Partial Class PartInfoResult
            '''<Summary>
            '''Unique ID for the part.
            '''</Summary>
            <ApiMember(Description:="Unique ID for the part.")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''Part number.
            '''</Summary>
            <ApiMember(Description:="Part number.")>
            Public Overridable Property PartNumber As String

            '''<Summary>
            '''Description of the part.
            '''</Summary>
            <ApiMember(Description:="Description of the part.")>
            Public Overridable Property Description As String

            '''<Summary>
            '''Part manufacturer.
            '''</Summary>
            <ApiMember(Description:="Part manufacturer.")>
            Public Overridable Property Manufacturer As String

            '''<Summary>
            '''Determines if the part can be ordered.
            '''</Summary>
            <ApiMember(Description:="Determines if the part can be ordered.")>
            Public Overridable Property CanBeOrdered As Boolean

            '''<Summary>
            '''Textual representation of the status of the part.
            '''</Summary>
            <ApiMember(Description:="Textual representation of the status of the part.")>
            Public Overridable Property StatusText As String

            '''<Summary>
            '''Available stock to order.
            '''</Summary>
            <ApiMember(Description:="Available stock to order.")>
            Public Overridable Property AvailableStockQuantity As Integer

            '''<Summary>
            '''Average days needed for delivery.
            '''</Summary>
            <ApiMember(Description:="Average days needed for delivery.")>
            Public Overridable Property AverageDeliveryInDays As Integer?

            '''<Summary>
            '''Price of a single unit, excluding VAT.
            '''</Summary>
            <ApiMember(Description:="Price of a single unit, excluding VAT.")>
            Public Overridable Property UnitPrice As Decimal?

            '''<Summary>
            '''EAN number.
            '''</Summary>
            <ApiMember(Description:="EAN number.")>
            Public Overridable Property EanNumber As String

            '''<Summary>
            '''Images
            '''</Summary>
            <ApiMember(Description:="Images")>
            Public Overridable Property Images As List(Of PartInfoResultImage)

            '''<Summary>
            '''Secondary article numbers
            '''</Summary>
            <ApiMember(Description:="Secondary article numbers")>
            Public Overridable Property SecondaryArticleNumbers As List(Of String)

            '''<Summary>
            '''Replacement article numbers
            '''</Summary>
            <ApiMember(Description:="Replacement article numbers")>
            Public Overridable Property ReplacementArticleNumbers As List(Of String)

            '''<Summary>
            '''Stock quantities
            '''</Summary>
            <ApiMember(Description:="Stock quantities")>
            Public Overridable Property StockQuantities As List(Of PartStockQuantity)
        End Class

        Public Partial Class PartInfoResultImage
            '''<Summary>
            '''Image number
            '''</Summary>
            <ApiMember(Description:="Image number")>
            Public Overridable Property ImageNumber As Integer

            '''<Summary>
            '''Image URL
            '''</Summary>
            <ApiMember(Description:="Image URL")>
            Public Overridable Property ImageUrl As String
        End Class

        Public Partial Class PartResults
            '''<Summary>
            '''Total number of parts available.
            '''</Summary>
            <ApiMember(Description:="Total number of parts available.")>
            Public Overridable Property TotalNumberOfParts As Integer

            '''<Summary>
            '''Indication if there are more parts to retrieve.
            '''</Summary>
            <ApiMember(Description:="Indication if there are more parts to retrieve.")>
            Public Overridable Property HasMoreRecords As Boolean

            '''<Summary>
            '''Part records.
            '''</Summary>
            <ApiMember(Description:="Part records.")>
            Public Overridable Property Parts As List(Of PartInfoResult)
        End Class

        Public Partial Class PartStockQuantity
            '''<Summary>
            '''Location ID
            '''</Summary>
            <ApiMember(Description:="Location ID")>
            Public Overridable Property LocationId As Integer

            '''<Summary>
            '''Location code
            '''</Summary>
            <ApiMember(Description:="Location code")>
            Public Overridable Property LocationCode As String

            '''<Summary>
            '''Stock quantity in location
            '''</Summary>
            <ApiMember(Description:="Stock quantity in location")>
            Public Overridable Property StockQuantity As Integer
        End Class
    End Namespace
End Namespace

VB.NET Authenticate 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.

POST /dealers/authenticate HTTP/1.1 
Host: services.acct.2service.nl 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

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

{
	Result: 
	{
		SessionToken: String
	},
	IsSuccessful: False,
	ErrorMessage: String
}