/permit/v1 README

Prerequisites

  • Client connection is based on HTTP. HTTP 1.0 and 1.1 are supported;
  • Client connection is secured using TLS protocol (HTTPS);
  • Client requests MUST conform to SOAP 1.2;
  • According to SOAP specification, messages MUST be encoded using UTF-8;
  • Dates are encoded as strings following ISO8601 format 2019-10-31T05:13:03Z;
  • SOAPAction header is not required nor is it parsed;

Authorization (HTTP header)

Authorization: KEY
  • KEY is 48 characters long

Simple example:

POST / HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8;
Connection: keep-alive
Content-Length: 669
Authorization: C7rlPhk2cQOHEL94WzwEKvUBrFwTTS0hxHKXsOC5OYP2zFkg

/permit/v1 Store permit

Method allows the requester to post a new permit to eparking.


Request

HTTP headers must include a valid authentication token

  • ObjectId is the id of the parking lot;
  • VehicleReg is vehicles registration number;
  • ParkingStartDateTime is permits start time;
  • ParkingEndDateTime is permits end time, if omitted permit won’t automatically expire (optional);
  • IssuedDateTime is the date when permit was generated;
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Body>
    <v1:StorePermitRequest xmlns:v1="http://soap.eparking.lv/permit/v1/">
      <ObjectId>110</ObjectId>
      <VehicleReg>127ASP</VehicleReg>
      <Permit>
         <ParkingStartDateTime>2019-10-31T05:13:03Z</ParkingStartDateTime>
         <ParkingEndDateTime>2019-10-31T05:13:43Z</ParkingEndDateTime>
         <IssuedDateTime>2019-10-31T05:13:03Z</IssuedDateTime>
      </Permit>
    </v1:StorePermitRequest>
  </s:Body>
</s:Envelope>

Response

Status: 200
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soap.eparking.lv/permit/v1/">
   <env:Body>
      <ns1:StorePermitResponse>
         <Status>OK</Status>
      </ns1:StorePermitResponse>
   </env:Body>
</env:Envelope>

For errors responses, see the response status codes documentation.

/permit/v1 Extend permit

Method allows the requester to extend existing permit in eparking.


Request

HTTP headers must include a valid authentication token

  • ObjectId is the id of the parking lot;
  • VehicleReg is vehicles registration number;
  • ParkingEndDateTime is permits new end time;
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Body>
    <v1:ExtendPermitRequest xmlns:v1="http://soap.eparking.lv/permit/v1/">
      <ObjectId>110</ObjectId>
      <VehicleReg>127ASP</VehicleReg>
      <Permit>
         <ParkingEndDateTime>2019-10-31T08:13:43Z</ParkingEndDateTime>
      </Permit>
    </v1:ExtendPermitRequest>
  </s:Body>
</s:Envelope>

Response

Status: 200
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soap.eparking.lv/permit/v1/">
   <env:Body>
      <ns1:ExtendPermitResponse>
         <Status>OK</Status>
      </ns1:ExtendPermitResponse>
   </env:Body>
</env:Envelope>

For errors responses, see the response status codes documentation.

/permit/v1 Stop permit

Method allows the requester to stop existing permit in eparking.


Request

HTTP headers must include a valid authentication token

  • ObjectId is the id of the parking lot;
  • VehicleReg is vehicles registration number;
  • ParkingEndDateTime is permits end time;
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Body>
    <v1:StopPermitRequest xmlns:v1="http://soap.eparking.lv/permit/v1/">
      <ObjectId>110</ObjectId>
      <VehicleReg>127ASP</VehicleReg>
      <Permit>
         <ParkingEndDateTime>2019-10-31T05:13:43Z</ParkingEndDateTime>
      </Permit>
    </v1:StopPermitRequest>
  </s:Body>
</s:Envelope>

Response

Status: 200
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soap.eparking.lv/permit/v1/">
   <env:Body>
      <ns1:StopPermitRequest>
         <Status>OK</Status>
      </ns1:StopPermitRequest>
   </env:Body>
</env:Envelope>

For errors responses, see the response status codes documentation.

/permit/v1 Error responses

Error response for Start, Stop and Extend permit requests

If the Authentication header is invalid or missing, empty response is returned with REST 401 Unauthorized.

  • Status values:

    OK Request succeeded with response code 200
    NOK Request failed with response code 200
  • Error field values

    key_expired Authorization credentials have expired
    key_disabled Authorization credentials have been disabled
    invalid_object_id ObjectId does not exist
    invalid_vehicle_reg Vehicle registry number parsing failed
    invalid_date_format Invalid date format
    invalid_time_dilation Invalid start and end date
    missing_permit Extending/stopping nonexistent permit
    duplicate Duplicate permit (still active)
    archived Stopping/extending already archived permit
    insufficient_privileges Partners permit API credentials have been revoked

Example

Status: 200
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soap.eparking.lv/permit/v1/">
   <env:Body>
      <ns1:StorePermitResponse>
         <Status>NOK</Status>
         <Error>duplicate</Error>
      </ns1:StorePermitResponse>
   </env:Body>
</env:Envelope>

Detailed error descriptions can be found in XSD


Error response for malfunctions

Status: 500
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://eparking.lv/soap/permit/v1/">
  <env:Body>
    <ns1:ErrorResponse>
      <Errors>
        <Error>
          <Message>Opening and ending tag mismatch: ExtendPermitRequest line 3 and ExtenPermitRequest</Message>
          <Line>9</Line> <!-- Optional -->
          <Column>29</Column> <!-- Optional -->
        </Error>
      </Errors>
    </ns1:ErrorResponse>
  </env:Body>
</env:Envelope>

libxml errors

Status: 500
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Body>
      <env:Fault>
         <env:Code>
            <env:Value>rpc:ProcedureNotPresent</env:Value>
         </env:Code>
         <env:Reason>
            <env:Text>Procedure not present</env:Text>
         </env:Reason>
      </env:Fault>
   </env:Body>
</env:Envelope>