Rest API for SPED

Work in progress...

Consignments API

  • Get consignment by id
Method: GET
URL: api/consignments/{consignmentId}
Path variables:
    consignmentId: id (long) of consignment
Returns: ConsignmentInfo if found
Example: https://ilogspeduat.wip.se/ilog-sped/api/consignments/123456
  • Delete by id
Method: DELETE
URL: api/consignments/{consignmentId}
Path variables:
    consignmentId: id (long) of consignment
Returns: ConsignmentInfo if found and removed
Example: https://ilogspeduat.wip.se/ilog-sped/api/consignments/123456

Lines API

  • Get line by id
Method: GET
URL: api/lines/{lineId}
Path variables:
    lineId: id (long) of line
Returns: LineInfo if found
Example: https://ilogspeduat.wip.se/ilog-sped/api/lines/123
  • Get line by uuid
Method: GET
URL: api/lines/{uuid}
Path variables:
    uuid:  uuid of line
Returns: LineInfo if found
Example: https://ilogspeduat.wip.se/ilog-sped/api/lines/3bf08563-d677-4bd3-954f-4e36f55f7b44
  • Get lines
Method: GET
URL: api/lines
RequestParam:
    groupId:  id of group, tot required. If no groupId all lines are returned  
Returns: List<LineInfo> if found
Example: https://ilogspeduat.wip.se/ilog-sped/api/lines?groupId=1
  • Post line
Method: POST
URL: api/lines
Body: 
Header: application/json        
Returns: 
  Status 200 with LineInfo if added 
  Status 422 when line with number already exists in given division
Example: curl  -X POST -H "Authorization: Basic YXBpdGVzdDp0ZXN0MTIz" -H "Content-Type: application/json"  -d '{"name":"Line name", "type":"TYPE_REMOTE", "operationId": 1, "number": "1234", "placement": 1,"divisionNumber": 174, "currentTransporter":{"transporternumber":12345}}'  'https://ilogspeduat.wip.se/ilog-sped/api/lines'
  • Delete by id
Method: DELETE
URL: api/lines/{lineId}
Path variables:
    lineId: id (long) of line
Returns: LineInfo if found and removed
Example: https://ilogspeduat.wip.se/ilog-sped/api/lines/123

ZipCodes API

  • Get zip code by code number
Method: GET
URL: api/zipcodes/{code}
Path variables:
    code: code number (string)
Returns: ZipCodeInfo if found
               404 Not Found if not found 
Example: https://ilogspeduat.wip.se/ilog-sped/api/zipcodes/37141
  • Post zip code
Method: POST
URL: api/zipcodes
Body: 
Header: application/json        
Returns: 
  Status 200 with ZipCodeInfo if added 
  Status 422 when zip code with number already exists
Example: curl  -X POST -H "Authorization: Basic YXBpdGVzdDp0ZXN0MTIz" -H "Content-Type: application/json"  -d '{"zipCode":"12345", "city": "TEST", "division": {"number": 174}, "defaultLine": {"id":1234} } ' 'https://ilogspeduat.wip.se/ilog-sped/api/zipcodes'
  • Delete by id
Method: DELETE
URL: api/zipcodes/{zipCodeId}
Path variables:
    code: id (long)
Returns: ZipCodeInfo if found and removed
Example: https://ilogspeduat.wip.se/ilog-sped/api/zipcodes/12345

Divisions API

  • Get division by id
Method: GET
URL: api/divisions/{divisionId}
Path variables:
    divisionId: id (long)
Returns: DivisionInfo if found
               404 Not Found if not found 
Example: https://ilogspeduat.wip.se/ilog-sped/api/divisions/1
  • Get divisions
Method: GET
URL: api/divisions/
Returns: List<DivisionInfo> if found
               404 Not Found if not found 
Example: https://ilogspeduat.wip.se/ilog-sped/api/divisions
  • Post division
Method: POST
URL: api/divisions
Body: 
Header: application/json        
Returns: 
  Status 200 with DivisionInfo if added 
  Status 422 when division with number already exists
Example: curl  -X POST -H "Authorization: Basic YXBpdGVzdDp0ZXN0MTIz" -H "Content-Type: application/json"  -d '{"name":"Test", "number": 1234 } ' 'https://ilogspeduat.wip.se/ilog-sped/api/divisions'
  • Delete by id
Method: DELETE
URL: api/divisions/{divisionId}
Path variables:
    code: id (long)
Returns: DivisionInfo if found and removed
Example: https://ilogspeduat.wip.se/ilog-sped/api/division/12345