tn:driver API reference 1.0 (17.04.2015)

Contents

Activation

Deactivation

Login

Logout

Update App Notification Registration

Required Data

New order registered in App (Header)

Order Event

Get Orders from Server

Orders downloaded from Server

Finished Order

Order Signature

Update Car/Driver Status

Device GPS Information

On Site GPS

Activate

For performing an activation request you have to submit the device id along with the Token to Transportnett API server

Request

Xml

POST https://driver.translog.no//api/Activate/Xml
Header
Content-Type: text/xml
Accept: application/xml

Request Body

<ActivateRequest> 
   <DeviceId>f6faac48ef5f0766</DeviceId> 
   <DeviceInformation> 
      <GCMMessageSupport>Supported</GCMMessageSupport> 
      <AppVersion>1.0</AppVersion> 
      <DeviceManufacturer>samsung</DeviceManufacturer> 
      <DeviceModel>SM-N9005</DeviceModel> 
      <DeviceOsName>Android</DeviceOsName> 
      <DeviceOsVersion>4.3</DeviceOsVersion> 
      <GooglePlayServicesVersion>4.1.32 (978161-38)</GooglePlayServicesVersion> 
   </DeviceInformation> 
   <Language>EN</Language> 
   <PhoneNumber></PhoneNumber> 
   <SecurityToken>{securitytoken}</SecurityToken> 
</ActivateRequest>

Json

POST https://driver.translog.no//api/Activate/Json
Header
Content-Type: application/json
Accept: application/json

Request Body

{
  "ActivateRequest": {
    "DeviceId": "f6faac48ef5f0766",
    "DeviceInformation": {
      "GCMMessageSupport": "Supported",
      "AppVersion": "1.0",
      "DeviceManufacturer": "samsung",
      "DeviceModel": "SM-N9005",
      "DeviceOsName": "Android",
      "DeviceOsVersion": "4.3",
      "GooglePlayServicesVersion": "4.1.32 (978161-38)"
    },
    "Language": "EN",
    "SecurityToken": "{securitytoken}"
  }
}

Parameters

The method does not require any parametes

Response

If successful, this method returns a response body with the following structure:

XML Response

Json Response


Deactivate

For performing an Deactivation request you have to submit the device id along with the Token UTF encoded to Transportnett API server

Request

Xml

POST https://driver.translog.no//api/Deactivate/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<DeactivateRequest>
   <DeviceId>f6faac48ef5f0766</DeviceId>
   <SecurityToken>Thomas001</SecurityToken>
</DeactivateRequest>

Json

POST https://driver.translog.no//api/Deactivate/Json
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

{
"DeactivateRequest":{
    "DeviceId": "f6faac48ef5f0766",
    "SecurityToken": "securitytoken"
}

Parameters

The method does not require any parametes

Response

Will provide an HTTP response 200 OK.


Login

For performing an Login request you have to submit the car id and driver id along with the Token to Transportnett API server

Request

Xml

XML: POST https://driver.translog.no//api/Login/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<UserLoginRequest>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
</UserLoginRequest>

Json

Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx
Json: POST https://driver.translog.no//api/Login/Json

Request Body

{
 "UserLoginRequest":{
    "CarId": 143,
    "DriverId": 174,
    "RemovOtherUser": "false"
    }
}

Parameters

The method does not require any parametes

XML Response

If successful, this method returns a response body with the following structure:

Json Response

If successful, this method returns a response body with the following structure:


Logout

For performing an Logout request you have to submit the car id and driver id along with the Token to Transportnett API server

Request

XML

POST https://driver.translog.no//api/Logout/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<UserLogoutRequest>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
</UserLogoutRequest>

Json

POST https://driver.translog.no//api/Logout/Json
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<UserLogoutRequest>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
</UserLogoutRequest>

Parameters

The method does not require any parametes

Response

If successful, Will provide an HTTP response 200 OK.


Update App Notification Registration

For performing an Update App notification request you have to submit the deviceregistration id and notificationregistration id along with the Token UTF encoded to Transportnett API server

Request

Xml

XML: POST https://driver.translog.no//api/PushNotificationRegistration/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<NotificationUpdateRequest> 
   <DeviceRegistrationId>APA91bH-WnjqFGN8CAbe7I8jTcM5luhUc9Z9qj79V0zsSrH3fr</<DeviceRegistrationId> 
   <NotificationRegistrationId>1424703395892504417-5812563559044046859-2</<NotificationRegistrationId>
</<NotificationUpdateRequest>

Json

POST https://driver.translog.no//api/PushNotificationRegistration/Json
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

{
 "NotificationUpdateRequest":{
   "DeviceRegistrationId": "APA91bH-WnjqFGN8CAbe7I8jTcM5luhUc9Z9qj79V0zsSrH3fr",
   "NotificationRegistrationId": "1424703395892504417-5812563559044046859-2"
   }
}

Parameters

The method does not require any parametes

Response

Will provide an HTTP response 200 OK.


Required data

Application needs to get some data from the server to work.
Token UTF encoded to Transportnett API server

Request

POST https://driver.translog.no//api/Required
Header
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Parameters

The method does not require any parametes

XML Response

Json Response


New order registered in App (Header)

When a new order is registered in App the App have to send Header with the Token to Transportnett API server

Request

XML

POST https://driver.translog.no//api/Order/New
Header
Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

Json

POST https://driver.translog.no//api/Order/NewJson
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

Response

If successful, this method returns a response body with the following structure:

XML Response

Json Response

Parameters

The method does not require any parametes


Order Event

Order event along with the Token to Transportnett API server

Events

15 Recived - when order is downloaded to App.

20 Read - when order is opened the first time in App.

100 Accepted - when order is accepted in App.

110 Started - first time user starts timer on of the order lines.

120 Done - order is set to finished in App.

500 Cancelled - order is deleted in app before it gets event 120 in App.

999 Declined - order is not accepted. (last event can't be more then 20)

Request

XML

POST https://driver.translog.no//api/Order/Event
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<OrderEventRequest> 
      <HeaderId> 96248</HeaderId> 
      <EventId> 110</EventId> 
      <CarId>469</CarId>
      <DriverId>123</DriverId> 
      <GPSInformation> 
        <Latitude> 123</Latitude> 
        <Longitude> 123</Longitude> 
        <TimeOfFix> 2014-01-01T12:00:00</TimeOfFix> 
        <AccuracyInMeters> 0</AccuracyInMeters> 
        <SpeedInMeters> 0</SpeedInMeters> 
        <GsmCoverage> 0</GsmCoverage> 
      </GPSInformation> 
</OrderEventRequest> 

Json

POST https://driver.translog.no//api/Order/EventJson
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

{
 "OrderEventRequest":{ 
      "HeaderId": 97062,
      "EventId": 110,
      "CarId": 469,
      "DriverId": 123,
      "GPSInformation":{
        "Latitude": 123,
        "Longitude": 123,
        "TimeOfFix": "2014-01-01T12:00:00",
        "AccuracyInMeters": 0,
        "SpeedInMeters": 0,
        "GsmCoverage": 0
 }
}

Parameters

The method does not require any parametes

Response

If successful, this method returns a response body with the following structure:

XML

<OrderEventResponse> 
	<HeaderId> 96248</HeaderId> 
	<EventId> 110</EventId> 
 </OrderEventResponse>

Json

{"HeaderId":97062,"EventId":110}

Get Orders from server

For performing an get order request you have to submit the carid and driverid and headerid if avileble along with the Token to Transportnett API server

Request

XML

POST https://driver.translog.no//api/Order/Get
Header
Content-Type: text/xml

Request Body

<GetOrderRequest>
    <CarId>469</CarId>
    <DriverId>369</DriverId>
    <Id>-1</Id>
</GetOrderRequest>

Json

POST https://driver.translog.no//api/Order/GetJson
Header
Content-Type: application/json

Request Body

{
 "GetOrderRequest":{
    "CarId": 143,
    "DriverId": 174,
    "Id": 97063
  }
}

Parameters

The method does not require any parametes

Response

If successful, this method returns a response body with the following structure:

XML

Json


Orders downloaded from Server

For performing an orders recived request you have to submit the carid, driverid and headerIds along with the Token UTF encoded to Transportnett API server

Request

XML

POST https://driver.translog.no//api/Order/Recived
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

<OrdersRecivedRequest>
    <CarId>469</CarId>
    <DriverId>369</DriverId>
    <HeaderIds>
        <Id>55040</Id>
    </HeaderIds>
</OrdersRecivedRequest>

Json

Json: POST https://driver.translog.no//api/Order/RecivedJson
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Request Body

{
 "OrdersRecivedRequest":{
    "CarId": 143,
    "DriverId": 174,
    "HeaderIds":[
        97063 
    ]
 }
}

Parameters

The method does not require any parametes

Response

Will provide an HTTP response 200 OK.


Finished Order

For sending an finishedorderrequest you have to submit the order along with the Token to Transportnett API server

Request

XML

Header
Content-Type: text/xml
Accept: application/xml
POST https://driver.translog.no/api/Order/Finished

Request Body

Json

Header
Content-Type: application/json
Accept: application/xml
Json: POST https://driver.translog.no/api/Order/FinishedJson

Request Body

Parameters

The method does not require any parametes

Response

If successful, this method returns a response body with the following structure:

XML

Json


Order Signature

For performing an Signature request you have to submit the signature along with the Token UTF encoded to Transportnett API server
Signature has to have HeaderId to be accepted by server

Request

XML

POST https://driver.translog.no/api/Order/Signature
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

XML Body

<SignatureRequest>
        <Signature>
        <HeaderId>96247</HeaderId>
        <OrderDetailLineId>-1</OrderDetailLineId>
        <DateTime>2014-02-10T14:15:00</DateTime>
        <SignatureText>tmt</SignatureText>
        <SignatureBinaryString></SignatureBinaryString>
        <GPSInformation>
          <Latitude>123</Latitude>
          <Longitude>123</Longitude>
          <TimeOfFix>2014-01-01T12:00:00</TimeOfFix>
          <AccuracyInMeters>0</AccuracyInMeters>
          <SpeedInMeters>0</SpeedInMeters>
          <GsmCoverage>0</GsmCoverage>
        </GPSInformation>
    </Signature>
</SignatureRequest>

Json

POST https://driver.translog.no/api/Order/SignatureJson
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Json Body

{
 "SignatureRequest":{
	"Signature":{
   		"HeaderId": 96247,
   		"OrderDetailLineId": "-1",
   		"DateTime": "2014-02-10T14:15:00",
   		"SignatureText": "tmt",
   		"SignatureBinaryString": "?????????????",
  		 "GPSInformation": {
      		"Latitude": "123",
      		"Longitude": "123",
      		"TimeOfFix": "2014-01-01T12:00:00",
      		"AccuracyInMeters": 0,
      		"SpeedInMeters": 0,
      		"GsmCoverage": 0
   			}
		}
	}
}

Parameters

The method does not require any parametes

Response

Will provide an HTTP response 200 OK.


Update Car/Driver Status

Request

XML

POST https://driver.translog.no//api/CarDriverStatus/Xml
Header
Content-Type: text/xml
Authorization: Basic dGhvbWFzQHRyYW5zcG9ydG5ldHQubm86YWUwZmIwZTEwZmI0ZjJmNmRhMjY5YzBhNTA5NTg4ZDVhMTE5ODFiOQ==

XML Body

<CarDriverStatusRequest>
  <StatusId>1</StatusId>
  <DateTime>2014-04-29T09:38:21</DateTime>
</CarDriverStatusRequest>

Json

POST https://driver.translog.no//api/CarDriverStatus/Json
Header
Content-Type: application/json
Authorization: Basic dGhvbWFzQHRyYW5zcG9ydG5ldHQubm86YWUwZmIwZTEwZmI0ZjJmNmRhMjY5YzBhNTA5NTg4ZDVhMTE5ODFiOQ==

Json Body

{
 "CarDriverStatusRequest":{
    "StatusId": 1,
    "DateTime": "2014-04-29T09:38:21",
    "CarId": 143,
    "DriverId": 174
  }
}

Parameters

The method does not require any parametes

Response

Will provide an HTTP response 200 OK.


Update Device GPS position on server

For performing an Update App notification request you have to submit the GPS Data to the server

Request

POST https://driver.translog.no//api/GPS/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

XML Body

<GPSInformation>
  <Latitude>59.907929</Latitude>
  <Longitude>10.619120</Longitude>
  <TimeOfFix>2013-10-03T12:59:22.2137725+02:00</TimeOfFix>
  <SpeedInMeters>20.40</SpeedInMeters>
  <AccuracyInMeters>28.423423</AccuracyInMeters>
  <GSMCoverage>30</GSMCoverage>
</GPSInformation>

Json

POST https://driver.translog.no//api/GPS/Json
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Json Body

{
 "GPSInformation":{
		"Latitude": 123,
		"Longitude": 123,
		"TimeOfFix": "2014-01-01T12:00:00",
		"AccuracyInMeters": 0,
		"SpeedInMeters": 0,
		"GsmCoverage": 0
	  }
}

Parameters

The method does not require any parameters

Response

Will provide an HTTP response 200.

Set On Site on order with GPSposition on server

Request

POST https://driver.translog.no//api/OnSite/Xml
Header
Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

XML Body

<OnSiteRequest>
  <Latitude>59.907929</Latitude>
  <Longitude>10.619120</Longitude>
  <TimeOfFix>2013-10-03T12:59:22.2137725+02:00</TimeOfFix>
  <HeaderId>123456</HeaderId>
</OnSiteRequest>

Json

POST https://driver.translog.no//api/OnSite/Json
Header
Content-Type: application/json
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

Json Body

{
 "OnSiteRequest":    {
    "HeaderId": 12211,
    "Latitude": "1231.123",
    "Longitude": "56.546",
    "TimeOfFix": "2017-04-03T13:31:00.4900276+02:00"
   }
}

Parameters

The method does not require any parameters

Response

Will provide an HTTP response 200.