tn:bulkcargo App API Reference 0.6

This API .

Activate

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

Request

Header

Content-Type: text/xml
Accept: application/xml

HTTP Request

 POST https://bulkcargo.translog.no/api/Activate

Parameters

The method does not require any parametes

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>

Response

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

Deactivate

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

Request

Header

Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Deactivate

Parameters

The method does not require any parametes

Request Body

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

Response

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

Header

Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/PushNotificationRegistration

Parameters

The method does not require any parametes

Request Body

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

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

Header

Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Required

Parameters

The method does not require any parametes

Response

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

Header

Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Login

Parameters

The method does not require any parametes

Request Body

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

Response

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

<UserLoginResponse>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
    <LoginResult>Ok</LoginResult>
</UserLoginResponse>
if car is loged in on some where else
<UserLoginResponse>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
    <LoginResult>OnAnotherDevice</LoginResult>
</UserLoginResponse>
if login failed
<UserLoginResponse>
    <CarId>1</CarId>
    <DriverId>1</DriverId>
    <LoginResult>Error</LoginResult>
    <ErrorMessage>ErrorMessage</ErrorMessage>
</UserLoginResponse>

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

Header

Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Logout

Parameters

The method does not require any parametes

Request Body

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

Response

If successful, Will provide an HTTP response 200 OK.

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

Header

Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Order/New

Parameters

The method does not require any parametes

Request Body

<NewOrderRequest> 
  <Header> 
    <CustomerId> 1417</CustomerId> 
    <SiteId> 16874</SiteId> 
    <SupervisiorId> 30</SupervisiorId> 
    <DateTime> 2014-02-06T12:00:00</DateTime> 
    <CarId> 476</CarId> 
    <DriverId> 375</DriverId> 
    <CreatedInApp> true</CreatedInApp> 
  </Header> 
</NewOrderRequest> 

Response

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

<NewOrderResponse> 
    <Header> 
        <Id>96251</Id> 
        <CustomerId> 1417</CustomerId> 
        <SiteId> 16874</SiteId> 
        <SupervisiorId> 30</SupervisiorId> 
        <DateTime> 2014-02-06T12:00:00</DateTime> 
        <CarId> 476</CarId> 
        <DriverId> 375</DriverId> 
        <CreatedInApp> true</CreatedInApp> 
    </Header> 
</NewOrderResponse> 

Order Event

Order event along with the Token to Transportnett API server

Request

Header

Content-Type: text/xml
Accept: application/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Order/Event

Parameters

The method does not require any parametes

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 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> 

Response

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

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

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

Header

Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Order/Signature

Parameters

The method does not require any parametes

Request Body

<FinishedOrdre>
    <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>

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

Header

Content-Type: text/xml
Accept: application/xml

HTTP Request

 POST https://bulkcargo.translog.no/api/Order/Finished

Parameters

The method does not require any parametes

Request Body

Response

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

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

Header

Content-Type: text/xml
Accept: application/xml

HTTP Request

 POST https://bulkcargo.translog.no/api/Orders/Get

Parameters

The method does not require any parametes

Request Body

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

Response

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

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

Header

Content-Type: text/xml
Authorization: Basic NTgwM2RhOWQxZDM3ZGM2MDozODRmNDJiZTVmN2FhNmU4YzEzN2I1MTk3NTNhYzFlZWVlYmVkYjUx

HTTP Request

 POST https://bulkcargo.translog.no/api/Order/Recived

Parameters

The method does not require any parametes

Request Body

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

Response

Will provide an HTTP response 200 OK.

Update Car/Driver Status

Request

Header

Accept: text/xml
Authorization: Basic dGhvbWFzQHRyYW5zcG9ydG5ldHQubm86YWUwZmIwZTEwZmI0ZjJmNmRhMjY5YzBhNTA5NTg4ZDVhMTE5ODFiOQ==

HTTP Request

 POST https://bulkcargo.translog.no/api/CarDriverStatus

Parameters

The method does not require any parametes

Request Body

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

Response

Will provide an HTTP response 200 OK.

GPS Information

Submit the device GPS information to the Transportnett Servers

How often should the device submit the GPS infotmation

On normal conditions it is required that bulkcargo App submit the GPS information to the servers every 60 seconds. However, if the GPS information for the device has not changed for say about 5 minutes, then the app can stop sending the GPS to server for 10 minutes. After 10 minutes, the app should again try to send the GPS information to the server.

Request

Header

Accept: text/xml
Authorization: Basic dGhvbWFzQHRyYW5zcG9ydG5ldHQubm86YWUwZmIwZTEwZmI0ZjJmNmRhMjY5YzBhNTA5NTg4ZDVhMTE5ODFiOQ==

HTTP Request

POST https://bulkcargo.translog.no/api/gps

Parameters

The method does not require any parameters

Request Body

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

Response

Will provide an HTTP response 200.

Set On Site on order with GPSposition on server

Request

POST https://bulkcargo.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://bulkcargo.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.