DISCLAIMER: Please note, this information is subject to change as content is still under development with MPI

Below is the technical information required for setting up the ERS Event APIs

ERS Event APIs

ERS Non-Fishing Event APIs

Trawl Event

The sections below describe the information necessary to create, get and update a trawl event.

Change history
Date Change
31/07/2017 Updated validation for attribute Codend Mesh Size Mm to allow 0's.
14/07/2017 Attribute Headline Height Metres validation updated to include decimal.
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
15/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
18/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trawl/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trawl/5ba04c30-c81a-4618-898e-e832da93cf98

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json

Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook)

Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)

Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)

Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the BT method must be reported through the Trawl Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Number of Nets Mandatory Number Must be a whole number.

Must be greater than 0.

Vessel Pair Number Optional String If a pair method is used, this is the other vessel involved in the fishing.

If provided, must be a valid vessel number.

Wing Spread Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Headline Height Metres Mandatory Number

Decimal to 2dp.

Must be greater than 0.

Codend Mesh Size Mm Mandatory Number Must be a whole number.

Must be 0 or greater.

Ground Rope Depth Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Bottom Depth Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Speed Knots Mandatory Number Decimal to 2dp.

Must be greater than 0.

Is Net Lost Conditional Boolean Records if the net has been lost and unable to be hauled.
Net at Depth Location Mandatory Geolocation Set See Geolocation Set Parameters below.

If not provided, ‘Is Net Lost’ must be true.

Net Leave Depth Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) leave depth.

If not provided, ‘Is Net Lost’ must be true.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Estimated Catch Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater.

If estimated catch > 0, then Catch must be provided (must have at least one catch record).

If estimated catch = 0 and Catch is provided, the ERS will still accept the event.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset
Manual Date Time Optional String Date 24 hr + UTC Offset
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Example:

{
  "eventHeader": {
    "tripid": "Trawltripid121",
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf9290",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Fishing conditions were poor",
    "completedDateTime": "2017-05-04T10:00:00+13:00",
  },
  "fishingMethodCode": "MW",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["BIB"],
  "startLocation": {
  "systemDateTime": "2017-05-24T08:01:00+13:00",
  "systemLocation": {
    "longitude": -175.5432,
    "latitude": -45.9878
                     },
  "manualDateTime": "2017-05-24T09:15:00+13:00",
  "manualLocation": {
     "longitude": -176.5432,
     "latitude": -46.9878
                    }
                   },
  "numberOfNets": 3,
  "vesselPairNumber": null,
  "wingSpreadMetres": 12,
  "headlineHeightMetres": 25.5,
  "codendMeshSizeMm": 5,
  "groundRopeDepthMetres": 11,
  "bottomDepthMetres": 150,
  "speedKnots": 7,
  "finishLocation": {
  "systemDateTime": "2017-05-24T12:30:00+13:00",
  "systemLocation": {
      "longitude": -174.5432,
      "latitude": -44.9878
                    },
                  },
 "isNetLost": false,
 "netAtDepthLocation": {
  "systemDateTime": "2017-05-24T08:01:00+13:00",
  "systemLocation": {
     "longitude": -175.5432,
     "latitude": -45.9878
                    },
  "manualDateTime": "2017-05-24T09:15:00+13:00",
                       },
  "netLeaveDepthLocation": {
   "systemDateTime": "2017-05-24T12:30:00+13:00",
   "manualLocation": {
       "longitude": -173.5432,
       "latitude": -43.9878
                     }
  },
  "estimatedCatchKg": 90,
  "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25,
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 23.75,
    }
  ],
   "isNonFishOrProtectedSpeciesCatchPresent": false,
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "seabirdCaptureCode": "W",
      "estimatedWeightKg": null,
      "numberUninjured": 1,
      "numberInjured": null,
      "numberDead": null,
      "tags": null
    },
    {
      "speciesCode": "DEN",
      "estimatedWeightKg": 5.5,
      "numberUninjured": null,
      "numberInjured": null,
      "numberDead": null,
      "tags": ["SG101", "SG105", "SG305", "SG501"]
    }
  ]
}
Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Parameter Data Type Validation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

 { 
  "errors": []
 }

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

 { 
  "errors": [ 
	 { 
		"propertyName": "EventId", 
		"attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91", 
		"errorCode": "DuplicateValue", 
		"errorMessage": "EventId already exists." 
	 } 
  ]
 }
 

Back to top

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trawl/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trawl/5ba04c30-c81a-4618-898e-e832da93cf98

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN
Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Number of Nets Number
Vessel Pair Number String
Wing Spread Metres Number
Headline Height Metres Number
Codend Mesh Size Mm Number
Ground Rope Depth Metres Number
Bottom Depth Metres Number
Speed Knots Number
Is Net Lost Boolean
Net at Depth Location See Geolocation Set Parameters below. Geolocation Set
Net Leave Depth Location See Geolocation Set Parameters below. Geolocation Set
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Estimated Catch Kg Number
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Example:

 
{
  "event": {
    "numberOfNets": 3,
    "vesselPairNumber": null,
    "wingSpreadMetres": 12,
    "headlineHeightMetres": 25.5,
    "codendMeshSizeMm": 5,
    "groundRopeDepthMetres": 11,
    "bottomDepthMetres": 150,
    "speedKnots": 7,
    "isNetLost": false,
    "estimatedCatchKg": 90,
    "netAtDepthLocation": {
      "systemDateTime": "2017-05-24T08:01:00+13:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": "2017-05-24T09:15:00+13:00",
      "manualLocation": null
    },
    "netLeaveDepthLocation": {
      "systemDateTime": "2017-05-24T12:30:00+13:00",
      "systemLocation": null,
      "manualDateTime": null,
      "manualLocation": {
        "longitude": -173.5432,
        "latitude": -43.9878
      }
    },
    "fishingMethodCode": "MW",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": [
      "BIB"
    ],
    "startLocation": {
      "systemDateTime": "2017-05-24T08:01:00+13:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": "2017-05-24T09:15:00+13:00",
      "manualLocation": {
        "longitude": -176.5432,
        "latitude": -46.9878
      }
    },
    "finishLocation": {
      "systemDateTime": "2017-05-24T12:30:00+13:00",
      "systemLocation": {
        "longitude": -174.5432,
        "latitude": -44.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": false,
    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25,
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "XAF",
        "seabirdCaptureCode": "W",
        "estimatedWeightKg": null,
        "numberUninjured": 1,
        "numberInjured": null,
        "numberDead": null,
        "tags": null
      },
      {
        "speciesCode": "DEN",
        "seabirdCaptureCode": null,
        "estimatedWeightKg": 5.5,
        "numberUninjured": null,
        "numberInjured": null,
        "numberDead": null,
        "tags": [
          "SG101",
          "SG105",
          "SG305",
          "SG501"
        ]
      }
    ],
    "tripId": "Trawltripid121",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf9290",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8462926",
    "completedDateTime": "2017-05-04T10:00:00+13:00",
    "notes": "Fishing conditions were poor",
    "amendmentReason": null
  },
  "errors": []
}

Back to top

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trawl/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trawl/5ba04c30-c81a-4618-898e-e832da93cf98

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will need to be passed in the request body.

ParameterRequiredData TypeDescription
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Example:

 
{
  "eventHeader": {
    "tripid": "Trawltripid1",
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf9290",
    "eventVersion": "2",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Fishing conditions were poor",
    "completedDateTime": null,
    "amendmentReason": "Wrong species code used"
  },
  "FishingMethodCode": "BT",
  "targetSpeciesCode": "SNA",
  "MitigationDeviceCodes": ["BIB"],
  "startLocation": {
    "systemDateTime": "2017-05-24T08:01:00+13:00",
       "systemLocation": {
           "longitude": -175.5432,
           "latitude": -45.9878
                                },
    "manualDateTime": "2017-05-24T09:15:00+13:00",
        "manualLocation": {
            "longitude": -176.5432,
             "latitude": -46.9878
                                }
  },
  "numberOfNets": 3,
  "vesselPairNumber": null,
  "wingSpreadMetres": 12,
  "headlineHeightMetres": 25.5,
  "codendMeshSizeMm": 5,
  "groundRopeDepthMetres": 11,
  "bottomDepthMetres": 150,
  "speedKnots": 7.5,
  "finishLocation": {
    "systemDateTime": "2017-05-24T12:30:00+13:00",
        "systemLocation": {
            "longitude": -174.5432,
            "latitude": -44.9878
                                },
  },
 "isNetLost": false,
"netAtDepthLocation": { "systemDateTime": "2017-05-24T08:01:00+13:00", "systemLocation": { "longitude": -175.5432, "latitude": -45.9878 }, "manualDateTime": "2017-05-24T09:15:00+13:00", }, "netLeaveDepthLocation": { "systemDateTime": "2017-05-24T12:30:00+13:00", "manualLocation": { "longitude": -173.5432, "latitude": -43.9878 } }, "estimatedCatchKg": 90, "catches": [ { "speciesCode": "SNA", "greenWeightEstimateKg": 50.25 }, { "speciesCode": "GSH", "greenWeightEstimateKg": 23.75 } ], "isNonFishOrProtectedSpeciesCatchPresent": false, "nonFishOrProtectedSpeciesCatches": [ { "speciesCode": "XAF", "seabirdCaptureCode": "W", "estimatedWeightKg": null, "numberUninjured": 1, "numberInjured": null, "numberDead": null, "tags": null }, { "speciesCode": "DEN", "estimatedWeightKg": 5.5, "numberUninjured": null, "numberInjured": null, "numberDead": null, "tags": ["SG101", "SG105", "SG305", "SG501", "SG111"] } ] }
Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{ 
"errors": []
}

Example 2:

{ 
	"errors": [ 
	{ 
	 "propertyName": "EventVersion", 
	 "attemptedValue": "2", 
	 "errorCode": "InvalidValue", 
	 "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again." 
	 } 
	]
}

Back to top

Potting Event

The sections below describe the information necessary to create, get and update a Potting event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
15/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
18/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/potting/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/potting/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the CP method must be reported through the potting Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Number of Lifts Mandatory Number Must be a whole number.

Records the number of pots or nets lifted.

Must be 0 or greater.

Soak Time Mandatory Number Whole hours only. Round up. Must be 0 or greater.
Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught.

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset
Manual Date Time Optional String Date 24 hr + UTC Offset
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

<

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example:

{
  "eventHeader": {
    "eventId":"5ba04c30-c81a-4618-898e-e832da93cf1532",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": "2017-04-10T09:15:00+11:00",
    "tripID": "589"
  },

  "fishingMethodCode": "RLP",
  "targetSpeciesCode": "ZAS",
  "mitigationDeviceCodes": ["SLE"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -88.9878,
    }
  },
  "isNonFishOrProtectedSpeciesCatchPresent": true,
  "numberOfLifts": 8,
  "soakTimeHours": 8,
 
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },
  
  "catches": [
    {
      "speciesCode": "ZAS",
      "greenWeightEstimateKg": 88.88,
    },
    {
      "speciesCode": "YBF",
      "greenWeightEstimateKg": 88.88,
    }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "FUG",
      "estimatedWeightKg": 88.88,
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": null
    },
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/potting/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/potting/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Number of Lifts Number
Soak Time Hours Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example:

{
  "event": {
    "numberOfLifts": 8,
    "soakTimeHours": 8,
    "fishingMethodCode": "RLP",
    "targetSpeciesCode": "ZAS",
    "mitigationDeviceCodes": [
      "SLE"
    ],
    "startLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -88.987799999999993
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": 174.6799,
        "latitude": -41.4289
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": true,
    "catches": [
      {
        "speciesCode": "ZAS",
        "greenWeightEstimateKg": 88.88,
      },
      {
        "speciesCode": "YBF",
        "greenWeightEstimateKg": 88.88,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "FUG",
        "seabirdCaptureCode": null,
        "estimatedWeightKg": 88.88,
        "numberUninjured": 8,
        "numberInjured": 8,
        "numberDead": 8,
        "tags": null
      }
    ],
    "tripId": "589",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf1532",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8462926",
    "completedDateTime": "2017-04-10T09:15:00+11:00",
    "notes": null,
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/potting/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/potting/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example:

{
  "eventHeader": {
    "eventId":"5ba04c30-c81a-4618-898e-e832da93cf1532",
    "eventVersion": 1,
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": "",
    "amendmentReason": "Typo mistake for YBF estimated catch",
    "tripID": "589"
  },

  "fishingMethodCode": "RLP",
  "targetSpeciesCode": "ZAS",
  "mitigationDeviceCodes": ["SLE"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -88.9878,
    }
  },
  "isNonFishOrProtectedSpeciesCatchPresent": true,
  "numberOfLifts": 11,
  "soakTimeHours": 11,
 
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },
 
"catches": [ { "speciesCode": "ZAS", "greenWeightEstimateKg": 88.88, }, { "speciesCode": "YBF", "greenWeightEstimateKg": 42.52, } ], "nonFishOrProtectedSpeciesCatches": [ { "speciesCode": "FUG", "estimatedWeightKg": 88.88, "numberUninjured": 8, "numberInjured": 8, "numberDead": 8, "tags": null }, ] }

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Netting Event

The sections below describe the information necessary to create, get and update a Netting event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
16/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
18/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/netting/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/netting/5ba04c30-c81a-4618-898e-e832da93cf99

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the DN method must be reported through the netting Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Number of Nets Mandatory Number Must be a whole number.

Must be greater than 0.

Total Length of Nets Metres Mandatory Number Decimal to 2dp. Must be greater than 0.
Min Mesh Size Mm Mandatory Number Must be a whole number.

Must be greater than 0.

Net Height Mandatory Number Must be a whole number.

Must be greater than 0.

Number of meshes

Is Net Lost Conditional Boolean Records if the net has been lost and unable to be hauled.
End of Set Location Mandatory Geolocation Set See Geolocation Set Parameters below.

If not provided, ‘Is Net Lost’ must be true.

Start of Haul Location Mandatory Geolocation Set See Geolocation Set Parameters below.

If not provided, ‘Is Net Lost’ must be true.

Estimated Green Weight for all other Species Kg Optional Number Decimal to 2dp. Must be 0 or greater.
Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught.

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater.

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Example:

{
  "eventHeader": {
    "eventId":"NET99",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": "2017-04-10T09:18:00+11:00",
    "tripID": "567",
    "notes": "Golden path - TEST"
  },
  "fishingMethodCode": "dn",
  "targetSpeciesCode": "KIN",
  "mitigationDevicesUsed": ["STR"],

  "isNonFishOrProtectedSpeciesCatchPresent": true,
  
  "totalLengthOfNetsMetres": 1,
  "minMeshSizeMm": 8,
  "netHeight": 8,
  "isNetLost": false,
  "numberOfNets": 1,
  "estimatedGreenWeightForAllOtherSpeciesKg":  18.8,
  
  "startLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -88.9878
    }
  },
  "finishLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -88.9878
    }
  },
  "endOfSetLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -88.9878
    }
  },
  "StartOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      }
   },  
  "catches": [
    {
      "speciesCode": "KIN",
      "greenWeightEstimateKg": 88.88
    },
    {
      "speciesCode": "DPO",
      "greenWeightEstimateKg": 88.88
    }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "estimatedWeightKg": 8,
      "numberUninjured": 88,
      "numberInjured": 88,
      "numberDead": 888,
      "tags": null
    }
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf99",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/netting/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/netting/5ba04c30-c81a-4618-898e-e832da93cf99

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Number of Nets Number
Total Length of Nets Metres Number
Min Mesh Size Mm Number
Net Height Number
Is Net Lost Boolean
End of Set Location See Geolocation Set Parameters below. Geolocation Set
Start of Haul Location See Geolocation Set Parameters below. Geolocation Set
Estimated Green Weight for all other Species Kg Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Example:

{
  "event": {
    "totalLengthOfNetsMetres": 1,
    "minMeshSizeMm": 8,
    "netHeight": 8,
    "isNetLost": false,
    "startOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "endOfSetLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -88.987799999999993
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "numberOfNets": 1,
    "estimatedGreenWeightForAllOtherSpeciesKg": 18.8,
    "fishingMethodCode": "dn",
    "targetSpeciesCode": "KIN",
    "mitigationDeviceCodes": [],
    "startLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -88.987799999999993
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -88.987799999999993
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": true,
    "catches": [
      {
        "speciesCode": "KIN",
        "greenWeightEstimateKg": 88.88,
      },
      {
        "speciesCode": "DPO",
        "greenWeightEstimateKg": 88.88,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "XAF",
        "seabirdCaptureCode": null,
        "estimatedWeightKg": 8,
        "numberUninjured": 88,
        "numberInjured": 88,
        "numberDead": 888,
        "tags": null
      }
    ],
    "tripId": "567",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "NET99",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8422125",
    "completedDateTime": "2017-04-10T09:18:00+11:00",
    "notes": "Golden path - TEST",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/netting/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/netting/5ba04c30-c81a-4618-898e-e832da93cf99

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeDescription
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Example:

{
  "eventHeader": {
    "eventId":"NET100",
    "eventVersion": 1,
    "vesselNumber": "1",
    "isVesselUsed": true,
    "tripID": "567",
    "notes": "Golden path UPDATE - TEST",
    "amendmentReason": "Wrong weight recorded for KIN"
  },
  "fishingMethodCode": "dn",
  "targetSpeciesCode": "KIN",
  "mitigationDevicesUsed": ["STR"],

  "isNonFishOrProtectedSpeciesCatchPresent": true,
  
  "totalLengthOfNetsMetres": 1,
  "minMeshSizeMm": 8,
  "netHeight": 8,
  "isNetLost": false,
  "numberOfNets": 1,
  "estimatedGreenWeightForAllOtherSpeciesKg":  18.8,
  
  "startLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -77.9878
    }
  },
  "finishLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -77.9878
    }
  },
  "endOfSetLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -77.9878
    }
  },
  "StartOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      }
   },  
  "catches": [
    {
      "speciesCode": "KIN",
      "greenWeightEstimateKg": 101.29
    },
    {
      "speciesCode": "DPO",
      "greenWeightEstimateKg": 88.88
    }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "estimatedWeightKg": 8,
      "numberUninjured": 88,
      "numberInjured": 88,
      "numberDead": 888,
      "tags": null
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Lining Event

The sections below describe the information necessary to create, get and update a Lining event.

Change history
Date Change
20/07/2017 Attribute Hook Space Metres validation changed to allow decimal.
14/07/2017 Attribute Hook Space Cm relabelled to Hook Space Metres.
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
16/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication.

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/lining/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the CP method must be reported through the potting Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Hook Space Metres Mandatory Number Decimal to 2dp.

Must be greater than 0.

Number of Hooks Mandatory Number Must be a whole number.

Must be 0 or greater.

Bottom Depth Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Is Line Lost Optional Boolean Records if the line has been lost and unable to be hauled.
End of Set Location Mandatory Geolocation Set See Geolocation Set Parameters below.

If not provided, ‘Is Line Lost’ must be true (or) fishing method is 'DL'.

Start of Haul Location Mandatory Geolocation Set See Geolocation Set Parameters below.

If not provided, ‘Is Line Lost’ must be true (or) fishing method is 'DL'.

Number of Lines Hauled Conditional Number

Must be provided if 'Fishing Methods' master data property 'require_lines_hauled = true'.

Must be a whole number.

Must be greater than 0.

Can be provided for other Fishing Methods, ERS will not reject the event if provided.

Estimated Green Weight for all other Species Kg Optional Number

Decimal to 2dp.

Must be 0 or greater.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "LiningEvent1",
    "tripId": "tr1",
    "completedDateTime": "2017-04-01T08:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes"
  },
  "fishingMethodCode": "BLL",
  "targetSpeciesCode": "SNA",
  "mitigationDevicesUsed": ["Bird Baffler", "Shouting"],
  "startLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "finishLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "endOfSetLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "StartOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      }
   },  
  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25
      },
      {
        "speciesCode": "CRA",
        "greenWeightEstimateKg": 23.75
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75
      }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
    "speciesCode": "XAS",
    "seabirdCaptureCode": "H",
    "estimatedWeightKg": null,
    "numberUninjured": null,
    "numberInjured": null,
    "numberDead": 23,
    "tags": null
   }
  ],
  
  "hookSpaceMetres": 99,
  "numberOfHooks": 5,
  "bottomDepthMetres": 346,

"estimatedGreenWeightForAllOtherSpeciesKg": 2,  
  "numberOfLinesHauled": 8,
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/lining/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/lining/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

Status Description
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Hook Space Metres Number
Number of Hooks Number
Bottom Depth Metres Number
Is Line Lost Boolean
End of Set Location See Geolocation Set Parameters below. Geolocation Set
Start of Haul Location See Geolocation Set Parameters below. Geolocation Set
Number of Lines Hauled Number
Estimated Green Weight for all other Species Kg Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
  "event": {
    "hookSpaceMetres": 99,
    "numberOfHooks": 5,
    "bottomDepthMetres": 346,
    "isLineLost": null,
    "numberOfLinesHauled": 8,
    "startOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "endOfSetLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "estimatedGreenWeightForAllOtherSpeciesKg": 2,
    "fishingMethodCode": "BLL",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": [],
    "startLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": false,
    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25,
      },
      {
        "speciesCode": "CRA",
        "greenWeightEstimateKg": 23.75,
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "XAS",
        "seabirdCaptureCode": "H",
        "estimatedWeightKg": null,
        "numberUninjured": null,
        "numberInjured": null,
        "numberDead": 23,
        "tags": null
      }
    ],
    "tripId": "tr1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "LiningEvent1",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8462926",
    "completedDateTime": "2017-04-01T08:00:00+13:00",
    "notes": "Some notes",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/lining/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeDescription
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
    "eventId": "123qwert",
    "eventVersion": "1",
    "tripId": "tr1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Lining Update - TEST",
    "amendmentReason": "wrong catch recorded for Hoki"
  },
  "fishingMethodCode": "BLL",
  "targetSpeciesCode": "SNA",
  "MitigationDeviceCodes":["ACC"],
  "startLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "finishLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "endOfSetLocation": {
    "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": -175.1025,
      "latitude": -45.9878
    }
  },
  "StartOfHaulLocation": {
      "systemDateTime": "2017-04-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.1025,
        "latitude": -45.9878
      }
   },  
  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25
      },
      {
        "speciesCode": "CRA",
        "greenWeightEstimateKg": 23.75
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 24.25
      }
  ],
  "nonFishOrProtectedSpeciesCatches": [{
    "speciesCode": "XAS",
    "SeabirdCaptureCode": "H",
    "estimatedWeightKg": 8,
    "numberUninjured": 88,
    "numberInjured": 888,
    "numberDead": 2,
    "tags": null}
  ],
  "HookSpaceMetres": 2,
  "NumberOfHooks": 2,
  "BottomDepthMetres": 2,
  "IsLineLost": false,
  
  "StartOfHaulDateTime": "2017-04-03T08:37:00+13:00",
  "estimatedGreenWeightForAllOtherSpeciesKg": 2,
  "NumberOfLinesHauled": 2
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Tuna Lining Event

The sections below describe the information necessary to create, get and update a Tuna Lining event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
09/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/tuna-lining/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/tuna-lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid Method for the Fishing Event Type. e.g a SLL code may be used for a Tuna Lining event.

Validated against the Fishing Methods master data.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Line Length Nm Mandatory Number

Decimal to 2dp.

Must be 0 or greater.

Number of Hooks Mandatory Number Must be a whole number.

Must be 0 or greater.

Number of Floats Mandatory Number Must be a whole number.

Must be 0 or greater.

Number of Lightsticks Mandatory Number Must be a whole number.

Must be 0 or greater.

Line Shooter Mandatory Boolean
Bait Type % - Fish Mandatory Number Decimal to 2dp.

Total Bait Type % must equal 100.

Must be 0 or greater.

Bait Type% - Other includes unbaited.

Bait Type % - Squid Mandatory Number
Bait Type % - Other Mandatory Number
Bait Type % - Artificial Mandatory Number
Is Line Lost Mandatory Boolean Records if the net has been lost and unable to be hauled.
Start of Haul Location Mandatory Geolocation Set See Geolocation Set Parameters below.
End of Set Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Catches Optional Array of catch Can be 0 or many Catch records. Records all species caught See Catches Parameters below.
Stocks Disposed Optional Array of stocks disposed Can be 0 or many stock disposed records.
Non Fish or Protected Species Catches Conditional Array of NFPS records See Non Fish or Protected Species Catches Parameters below. Mandatory if Is Non Fish Or Protected Species Catch Present is ‘Yes’

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional Stirng Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided. See Geolocation parameters below.
Manual Location Conditional Geolocation


Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Product State Code Mandatory String

Must be a valid product state code.

Validated against Product States master data.

Processed Weight Kg Mandatory Number Must be a whole number.

Must be greater than 0.

Number of Fish Mandatory Number Must be a whole number.

Must be greater than 0.

Stocks Disposed Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Stock Code Mandatory String

Must be a valid ERS stock code.

Validated against Fish Stock master data.

Disposal Code Mandatory String

Must be a valid disposal code.

Validated against Disposal Codes master data.

Estimated Green Weight Kg Mandatory Number Decimal to 2dp.

Must be greater than 0.

Number of Fish Mandatory Number Must be a whole number.

Must be greater than 0.

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid NFPS species code. Validated against NFPS master data.
Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'. Validated against the Seabird Capture Codes master data.
Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

 {
  "eventHeader": {
    "eventId": "TL017",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes",
    "completedDateTime": "2017-05-29T09:00:00+13:00",
    "tripId": "TL013"
  },
  "fishingMethodCode": "SLL",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["OTH", "LAS"],
  "startLocation": {
      "systemDateTime": "2017-05-24T08:01:00+13:00",
       "systemLocation": {
            "longitude": -175.5432,
            "latitude": -45.9878
                                },
       "manualDateTime": "2017-05-24T09:15:00+13:00",
        "manualLocation": {
            "longitude": -176.5432,
             "latitude": -46.9878
                                }
                },
  "finishLocation": {
       "systemDateTime": "2017-05-24T12:30:00+13:00",
        "systemLocation": {
            "longitude": -174.5432,
            "latitude": -44.9878
                                },
        "manualDateTime": "2017-05-24T13:33:00+13:00",
        "manualLocation": {
            "longitude": -173.5432,
            "latitude": -43.9878
                                }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": true,

    "catches": [
    {
      "speciesCode": "SNA",
      "processedWeightKg": 29,
      "productStateCode": "FIN",
      "NumberOfFish": 3
    }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "seabirdCaptureCode": "S",
      "estimatedWeightKg": 4,
      "numberUninjured": 4,
      "numberInjured": 1,
      "numberDead": 0,
      "tags": null
    }
  ],
  
  "lineLengthNm": 99.7,
  "numberOfHooks": 66,
  "numberOfFloats": 4,
  "numberOfLightsticks": 3,
  "lineShooter": true,
  "baitTypePercentFish": 25,
  "baitTypePercentSquid": 50,
  "baitTypePercentOther": 25,
  "baitTypePercentArtifical": 0,
  "endOfSetLocation": {
			"systemDateTime": "2017-05-24T12:30:00+13:00",
			"systemLocation": {
			       "longitude": -174.5432,
			       "latitude": -44.9878
			}
  },
  "isLineLost": false,
  "startOfHaulLocation": {
			"systemDateTime": "2017-05-24T12:30:00+13:00",
			"systemLocation": {
				"longitude": -174.5432,
				"latitude": -44.9878
			}
  },
  "stocksDisposed": [
                {
		"numberOfFish": 5,
		"stockCode": "ANG13",
		"disposalCode": "E",
		"estimatedGreenWeightKg": 23
		}
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/tuna-lining/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/tuna-lining/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

Status Description
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String

Start Location See Geolocation Set Parameters below.

Geolocation Set
Line Length Nm Number
Number of Hooks Number
Number of Floats Number
Number of Lightsticks Number
Line Shooter Boolean
Bait Type % - Fish Number
Bait Type % - Squid Number
Bait Type % - Other Number
Bait Type % - Artificial Number
Is Line Lost Boolean
Start of Haul Location See Geolocation Set Parameters below. Geolocation Set
End of Set Location See Geolocation Set Parameters below. Geolocation Set
Finish Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Completed Date Time String
Catches See Catches Parameters below. Array of catch
Stocks Disposed See Stocks Disposed Parameters below. Array of stocks disposed
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location See Geolocation Parameters below. Geolocation
Manual Location See Geolocation Parameters below. Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees


Catches Parameters:

ParameterData Type
Species Code String
Product State Code String
Processed Weight Kg Number
Number of Fish Number

Stocks Disposed Parameters:

ParameterData Type
Stock Code String
Disposal Code String
Estimated Green Weight Kg Number
Number of Fish Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
  "event": {
    "lineLengthNm": 99.7,
    "numberOfHooks": 66,
    "numberOfFloats": 4,
    "numberOfLightsticks": 3,
    "lineShooter": true,
    "baitTypePercentFish": 25,
    "baitTypePercentSquid": 50,
    "baitTypePercentOther": 25,
    "baitTypePercentArtifical": 0,
    "endOfSetLocation": {
      "systemDateTime": "2017-05-24T12:30:00+13:00",
      "systemLocation": {
        "longitude": -174.5432,
        "latitude": -44.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isLineLost": false,
    "startOfHaulLocation": {
      "systemDateTime": "2017-05-24T12:30:00+13:00",
      "systemLocation": {
        "longitude": -174.5432,
        "latitude": -44.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "fishingMethodCode": "SLL",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": [
      "OTH",
      "LAS"
    ],
    "startLocation": {
      "systemDateTime": "2017-05-24T08:01:00+13:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": "2017-05-24T09:15:00+13:00",
      "manualLocation": {
        "longitude": -176.5432,
        "latitude": -46.9878
      }
    },
    "finishLocation": {
      "systemDateTime": "2017-05-24T12:30:00+13:00",
      "systemLocation": {
        "longitude": -174.5432,
        "latitude": -44.9878
      },
      "manualDateTime": "2017-05-24T13:33:00+13:00",
      "manualLocation": {
        "longitude": -173.5432,
        "latitude": -43.9878
      }
    },
    "isNonFishOrProtectedSpeciesCatchPresent": true,
    "catches": [
      {
        "speciesCode": "SNA",
        "productStateCode": "FIN",
        "processedWeightKg": 29,
        "numberOfFish": 3
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "XAF",
        "seabirdCaptureCode": "S",
        "estimatedWeightKg": 4,
        "numberUninjured": 4,
        "numberInjured": 1,
        "numberDead": 0,
        "tags": null
      }
    ],
    "eventId": "TL017",
    "tripId": "TL013",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8491346",
    "completedDateTime": "2017-05-29T09:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Some notes",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/tuna-lining/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/tuna-lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeDescription
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

  {
  "eventHeader": {
    "eventId": "TL017",
    "eventVersion": 1,
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": null,
    "tripId": "TL013",
    "amendmentReason": "Audit error"
  },
  "fishingMethodCode": "SLL",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["OTH", "LAS"],
  "startLocation": {
      "systemDateTime": "2017-05-24T08:01:00+13:00",
       "systemLocation": {
            "longitude": -175.5432,
            "latitude": -45.9878
                                },
       "manualDateTime": "2017-05-24T09:15:00+13:00",
        "manualLocation": {
            "longitude": -176.5432,
             "latitude": -46.9878
                                }
                },
  "finishLocation": {
       "systemDateTime": "2017-05-24T12:30:00+13:00",
        "systemLocation": {
            "longitude": -174.5432,
            "latitude": -44.9878
                                },
        "manualDateTime": "2017-05-24T13:33:00+13:00",
        "manualLocation": {
            "longitude": -173.5432,
            "latitude": -43.9878
                                }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": true,

    "catches": [
    {
      "speciesCode": "SNA",
      "processedWeightKg": 29,
      "productStateCode": "FIN",
      "NumberOfFish": 3
    }
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "seabirdCaptureCode": "S",
      "estimatedWeightKg": 4,
      "numberUninjured": 4,
      "numberInjured": 1,
      "numberDead": 0,
      "tags": null
    }
  ],
  
  "lineLengthNm": 99.7,
  "numberOfHooks": 66,
  "numberOfFloats": 4,
  "numberOfLightsticks": 3,
  "lineShooter": true,
  "baitTypePercentFish": 25,
  "baitTypePercentSquid": 50,
  "baitTypePercentOther": 25,
  "baitTypePercentArtifical": 0,
  "endOfSetLocation": {
                       "systemDateTime": "2017-05-24T12:30:00+13:00",
                       "systemLocation": {
                              "longitude": -174.5432,
                               "latitude": -44.9878
                                }
  },
  "isLineLost": false,
  "startOfHaulLocation": {
                         "systemDateTime": "2017-05-24T12:30:00+13:00",
                          "systemLocation": {
                               "longitude": -174.5432,
                               "latitude": -44.9878
                                }
  },
  "stocksDisposed": [
                {
                  "numberOfFish": 5,
                  "stockCode": "ANG13",
                   "disposalCode": "E",
                   "estimatedGreenWeightKg": 23
                }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Other Lining Event

The sections below describe the information necessary to create, get and update an Other Lining event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
23/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/other-lining/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/other-lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the HL method must be reported through the lining Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Maximum Number of Lines Used Mandatory Number Must be a whole number.

Must be 0 or greater.

Maximum Number of Hooks Used Mandatory Number Must be a whole number.

Must be 0 or greater.

Finish Location Mandatory Geolocation Set See Finish Geolocation Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught.

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "123",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "tripID": "999",
    "completedDateTime": "2017-01-01T08:00:00+13:00",
    "notes" : "Other Lining Create - TEST"
  },
  "fishingMethodCode": "T",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["DDD"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -45.9878
    }
  },
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": false,
   "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75
      }
  ],
  "nonFishOrProtectedSpeciesCatches": [],
  
  "MaximumNumberOfLinesUsed": 3,
  "MaximumNumberOfHooksUsed": 3
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/other-lining/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/other-lining/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Maximum Number of Lines Hauled Number
Maximum Number of Hooks Used Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
    "event": {
        "maximumNumberOfLinesUsed": 3,
        "maximumNumberOfHooksUsed": 3,
        "fishingMethodCode": "T",
        "targetSpeciesCode": "SNA",
        "mitigationDeviceCodes": [
        "DDD"
        ],
        "startLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": -175.5432,
                "latitude": -45.9878
            },
            "manualDateTime": null,
            "manualLocation": null
        },
        "finishLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": 174.6799,
                "latitude": -41.4289
            },
            "manualDateTime": null,
            "manualLocation": null
        },
        "isNonFishOrProtectedSpeciesCatchPresent": false,
        "catches": [
            {
                "speciesCode": "SNA",
                "greenWeightEstimateKg": 50.25,
            },
            {
                "speciesCode": "HOK",
                "greenWeightEstimateKg": 23.75,
            }
        ],
        "nonFishOrProtectedSpeciesCatches": [],
        "tripId": "999",
        "vesselNumber": "1",
        "isVesselUsed": true,
        "eventId": "123",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8462926",
        "completedDateTime": "2017-01-01T08:00:00+13:00",
        "eventDateTime": "2017-04-10T09:15:00+11:00",
        "notes": "Other Lining Create - TEST",
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/other-lining/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/other-lining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
    "eventId": "123",
    "eventVersion": "1",
    "tripId": "999",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Comments",
    "amendmentReason": "wrong greenweight recorded for hoki"

  },
    "fishingMethodCode": "T",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": ["DDD"],
  "startLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": -175.5432,
                "latitude": -45.9878
            },
            "manualDateTime": null,
            "manualLocation": null
        },
        "finishLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": 174.6799,
                "latitude": -41.4289
            },
            "manualDateTime": null,
            "manualLocation": null
        },

  "isNonFishOrProtectedSpeciesCatchPresent": false,
   "catches": [
            {
                "speciesCode": "SNA",
                "greenWeightEstimateKg": 50.25,
            },
            {
                "speciesCode": "HOK",
                "greenWeightEstimateKg": 24.75,
            }
        ],
  "nonFishOrProtectedSpeciesCatches": [],
  
  "MaximumNumberOfLinesUsed": 3,
  "MaximumNumberOfHooksUsed": 3,
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Hand Gathering Event

The sections below describe the information necessary to create, get and update a Hand Gathering event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
19/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/hand-gathering/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/hand-gathering/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the H method must be reported through the hand gathering Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Number of People Mandatory Number Must be a whole number.

Must be greater than 0.

Time Spent Hours Mandatory Number Must be a whole number.

Must be greater than 0.

Round up.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught.

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
  "eventId": "qweasd123",
  "isVesselUsed": false,
  "notes": "Hand gathering CREATE - TEST",
  "tripID": "111",
  "completedDateTime": "2017-01-01T08:00:00+13:00"
  },
  "numberOfPeople": 1,
  "timeSpentHours": 1,
  "isNonFishOrProtectedSpeciesCatchPresent": false,

  "fishingMethodCode": "H",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["STR"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -45.9878
    }
  },
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },
   "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 23.75
    }
    ],
  
  
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "estimatedWeightKg": null,
      "seabirdCaptureCode": "",
      "numberUninjured": 1,
      "numberInjured": null,
      "numberDead": null,
      "tags": null
    },
    {
      "speciesCode": "DEN",
      "estimatedWeightKg": 5.5,
      "numberUninjured": null,
      "numberInjured": null,
      "numberDead": null,
      "tags": ["SG101", "SG105", "SG305", "SG501"]
    }
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/hand-gathering/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/hand-gathering/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Number of People Number
Time Spent Hours Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
    "event": {
        "numberOfPeople": 1,
        "timeSpentHours": 1,
        "fishingMethodCode": "H",
        "targetSpeciesCode": "SNA",
        "mitigationDeviceCodes": [
            "STR"
        ],
        "startLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": -175.5432,
                "latitude": -45.9878
            },
            "manualDateTime": null,
            "manualLocation": null
        },
        "finishLocation": {
            "systemDateTime": "2017-04-10T09:15:00+11:00",
            "systemLocation": {
                "longitude": 174.6799,
                "latitude": -41.4289
            },
            "manualDateTime": null,
            "manualLocation": null
        },
        "isNonFishOrProtectedSpeciesCatchPresent": false,
        "catches": [
            {
                "speciesCode": "SNA",
                "greenWeightEstimateKg": 50.25,
            },
            {
                "speciesCode": "HOK",
                "greenWeightEstimateKg": 23.75,
            }
        ],
        "nonFishOrProtectedSpeciesCatches": [
            {
                "speciesCode": "XAF",
                "seabirdCaptureCode": "",
                "estimatedWeightKg": null,
                "numberUninjured": 1,
                "numberInjured": null,
                "numberDead": null,
                "tags": null
            },
            {
                "speciesCode": "DEN",
                "seabirdCaptureCode": null,
                "estimatedWeightKg": 5.5,
                "numberUninjured": null,
                "numberInjured": null,
                "numberDead": null,
                "tags": [
                    "SG101",
                    "SG105",
                    "SG305",
                    "SG501"
                ]
            }
        ],
        "tripId": "111",
        "vesselNumber": null,
        "isVesselUsed": false,
        "eventId": "qweasd123",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8462926",
        "completedDateTime": "2017-01-01T08:00:00+13:00",
        "notes": "Hand gathering - TEST",
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/hand-gathering/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/hand-gathering/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
  "eventId": "qweasd123",
  "isVesselUsed": false,
  "notes": "Hand gathering UPDATE - TEST",
  "tripID": "111",
  "eventVersion": 1,
  "AmendmentReason": "Wrong species code used "
  },
  "numberOfPeople": 8,
  "timeSpentHours": 8,
  "isNonFishOrProtectedSpeciesCatchPresent": false,
  
  "fishingMethodCode": "H",
  "targetSpeciesCode": "HOK",
  "mitigationDeviceCodes": ["ACC"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -44.9878
    }
  },
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-44.4289"
      }
  },
   "catches": [
    {
      "speciesCode": "GSH",
      "greenWeightEstimateKg": 55.55
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 44.44
    }
    ],
  
  
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "XAF",
      "estimatedWeightKg": 8,
      "seabirdCaptureCode": "",
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": 8
    },
    {
      "speciesCode": "DEN",
      "estimatedWeightKg": 5.5,
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": ["SG101", "SG105", "SG305", "SG501"]
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Diving Event

The sections below describe the information necessary to create, get and update a Diving event.

Change history
Date Change
14/07/2017 Attribute Diver Catch relabelled to Diver Catches and Diver Details relabelled to Divers.
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
22/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication.

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/diving/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/diving/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the DI method must be reported through the diving Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Divers Mandatory Array of Divers See Divers Parameters below.

Must have at least one diver record.

Can have many divers associated with the event.

Catch details are also recorded against each diver.

Swell Metres Mandatory Number Decimal to 2dp.

Must be 0 or greater.

Visibility Metres Mandatory Number Must be a whole number.

Must be 0 or greater.

Was Boat Person Used Conditional Boolean Must be provided if 'Fish Species' master data property 'require_boat_person_used = true'.
Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught.

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Divers Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Diver ID or Name Mandatory String Maximum of 50 characters. 
Total Diving Time Hours Mandatory Number Must be a whole number.

Must be greater than 0.

Diver Catches Optional Array of Diver Catches See Diver Catches Parameters below.

Diver Catches Parameters:

Note that, in addition to the diver catches details, we also get the standard catches details. ERS will not validate that the two datasets are consistent.

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid ERS species code.

Validated against Fish Species ERS master data.

Must not be provided if 'Fish Species' master data property 'not_allowed_for_diving = true'.

Estimated Catch Kg Mandatory Number Decimal to 2dp.

Must be greater than 0.

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "tripId": "tr1",
    "vesselNumber": "1",
    "isVesselUsed": true,
	"notes" : "Fishing conditions were poor",
    "completedDateTime": "2017-04-01T12:30:00+13:00"
  },

  "fishingMethodCode": "di",
  "targetSpeciesCode": "pau",
  "MitigationDeviceCodes":["ACC"],
  "startLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
    "longitude": "-175.5432",
      "latitude": "-45.9878"
      }
  },
  "isNonFishOrProtectedSpeciesCatchPresent": false,
  "nonFishOrProtectedSpeciesCatches": [],
  "finishDateTime": "2017-04-01T12:30:00+13:00",
  "finishLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
    "longitude": "-175.5432",
      "latitude": "-45.9878"
      }
  },
  "catches": [{
    "speciesCode": "PAU",
    "greenWeightEstimateKg": 50.25
  }],
  "swellMetres": 1.25,
  "visibilityMetres": 10,
  "wasBoatPersonUsed": true,
  "divers": [
    {  
      "diverIdOrName": "DiverDave",
      "totalDivingTimeHours": 8,
      "diverCatches": [
        {"speciesCode": "PAA",   "estimatedCatchKg": 27.75},
        {"speciesCode": "PAI",   "estimatedCatchKg": 5.75}
      ]
    }
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/diving/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/diving/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Divers See Divers Parameters below. Array of Divers
Swell Metres Number
Visibility Metres Number
Was Boat Person Used Boolean
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Divers Parameters:

ParameterData Type
Diver ID or Name String
Total Diving Time Hours Number
Diver Catches See Diver Catches Parameters below. Array of Diver Catches

Diver Catches Parameters:

ParameterData Type
Species Code String
Estimated Catch Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
  "event": {
    "swellMetres": 1.25,
    "visibilityMetres": 10,
    "wasBoatPersonUsed": true,
    "divers": [
      {
        "diverIdOrName": "DiverDave",
        "totalDivingTimeHours": 8,
        "diverCatches": [
          {
            "speciesCode": "PAA",
            "estimatedCatchKg": 27.75
          },
          {
            "speciesCode": "PAI",
            "estimatedCatchKg": 5.75
          }
        ]
      }
    ],
    "fishingMethodCode": "di",
    "targetSpeciesCode": "pau",
    "mitigationDeviceCodes": [
      "ACC"
    ],
    "startLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": false,
    "catches": [
      {
        "speciesCode": "PAU",
        "greenWeightEstimateKg": 50.25,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [],
    "tripId": "tr1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "0ae7d65a-d651-1f46-289e-eefb2299a183",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8491346",
    "completedDateTime": "2017-04-01T12:30:00+13:00",
    "notes": null,
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/diving/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/diving/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

 
{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "eventVersion": 3,
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": null,
    "tripID": "hhh",
    "amendmentReason": "error found during internal audit. Wrong number of diving hours recorded"
  },

  "fishingMethodCode": "di",
  "targetSpeciesCode": "CRA",

  "startLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
    "longitude": "-175.5432",
      "latitude": "-45.9878"
      }
  },
  "isNonFishOrProtectedSpeciesCatchPresent": true,
  "nonFishOrProtectedSpeciesCatches": [
        {
      "speciesCode": "XAF",
      "estimatedWeightKg": 8,
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": null
    }
    ],
  "finishLocation": {
      "systemDateTime": "2017-03-28T09:15:00+11:00",
      "systemLocation": {
    "longitude": "-175.5432",
      "latitude": "-45.9878"
      }
  },
  "swellMetres": 1.25,
  "visibilityMetres": 10,
  "wasBoatPersonUsed": true,
  "divers": [
    {  
      "diverIdOrName": "DiverDave",
      "totalDivingTimeHours": 9,
         "diverCatches": [
          {
            "speciesCode": "PAA",
            "estimatedCatchKg": 27.75
          },
          {
            "speciesCode": "PAI",
            "estimatedCatchKg": 5.75
          }
        ]
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Seining Event

The sections below describe the information necessary to create, get and update a Seining event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
19/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/seining/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/seining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the PS method must be reported through the seining Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Total Net Length And Warps Metres Conditional Number Must be a whole number.

Must be provided if 'Fishing Method' master data property 'require_net_details = true'.

Reject if provided for other methods.

Must be greater than 0.

Ground Rope Length Metres Conditional Number Must be a whole number.

Must be provided if 'Fishing Method' master data property 'require_rope_details = true'.

Reject if provided for other methods.

Must be greater than 0.

Is Spotter Used Conditional Boolean Must be provided if 'Fishing Method' master data property 'require_spotter_used = true'.

Reject if provided for other methods.

Spotter Call Sign Conditional String Must be provided if 'Is Spotter Used' = True.

If 'Is Spotter Used' = False and fisher provides a call sign, ERS will accept the event.

Maximum of 100 characters allowed.

Number of Lifts Conditional Number Must be a whole number.

Must be provided if 'Fishing Method' master data property 'require_number_of_lifts = true'.

Reject if provided for other methods.

Must be greater than 0.

Estimated Catch Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater.

If estimated catch > 0, then Catch must be provided.

If estimated catch = 0 and Catch is provided, the ERS will still accept the event.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "S0111",
    "completeddatetime": "2017-04-30T08:00:00+13:00",
    "tripid": "seiningtrip1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes"
  },
  "startDateTime": "2017-04-30T08:00:00+13:00",
  "fishingmethodcode": "DPN",
  "targetSpeciesCode": "SNA",
  "mitigationDevicecodes": ["ACC", "BIB"],
    "startLocation": {
                                "systemDateTime": "2017-05-24T08:01:00+13:00",
                                "systemLocation": {
                                    "longitude": -175.5432,
                                    "latitude": -45.9878
                                },
                                "manualDateTime": "2017-05-24T09:15:00+13:00",
                                "manualLocation": {
                                    "longitude": -176.5432,
                                    "latitude": -46.9878
                                }
                },

    "finishLocation": {
                                "systemDateTime": "2017-05-24T12:30:00+13:00",
                                "systemLocation": {
                                    "longitude": -174.5432,
                                    "latitude": -44.9878
                                },
                                "manualDateTime": "2017-05-24T13:33:00+13:00",
                                "manualLocation": {
                                    "longitude": -173.5432,
                                    "latitude": -43.9878
                                }
  },


  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25
    },
    {
      "speciesCode": "CRA",
      "greenWeightEstimateKg": 23.75
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 23.75
    }
    
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
     "speciesCode": "XAF",
      "estimatedWeightKg": 4,
      "numberUninjured": 4,
      "numberInjured": 1,
      "numberDead": 0,
      "tags": null
    }
  ],
  
  "GroundRopeLengthMetres": null,
  "SpotterCallSign": null,
  "IsSpotterUsed": null,
  "NumberOfLifts": 6,
  "EstimatedCatchKg": 87.5
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/seining/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/seining/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Total Net Length And Warps Metres Number
Ground Rope Length Metres Number
Is Spotter Used Boolean
Spotter Call Sign String
Number of Lifts Number
Estimated Catch Kg Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
    "event": {
        "totalNetLengthAndWarpsMetres": null,
        "groundRopeLengthMetres": null,
        "isSpotterUsed": null,
        "spotterCallSign": null,
        "numberOfLifts": 6,
        "estimatedCatchKg": 87.5,
        "fishingMethodCode": "DPN",
        "targetSpeciesCode": "SNA",
        "mitigationDeviceCodes": [
            "ACC",
            "BIB"
        ],
        "startLocation": {
            "systemDateTime": "2017-05-24T08:01:00+13:00",
            "systemLocation": {
                "longitude": -175.5432,
                "latitude": -45.9878
            },
            "manualDateTime": "2017-05-24T09:15:00+13:00",
            "manualLocation": {
                "longitude": -176.5432,
                "latitude": -46.9878
            }
        },
        "finishLocation": {
            "systemDateTime": "2017-05-24T12:30:00+13:00",
            "systemLocation": {
                "longitude": -174.5432,
                "latitude": -44.9878
            },
            "manualDateTime": "2017-05-24T13:33:00+13:00",
            "manualLocation": {
                "longitude": -173.5432,
                "latitude": -43.9878
            }
        },
        "isNonFishOrProtectedSpeciesCatchPresent": false,
        "catches": [
            {
                "speciesCode": "SNA",
                "greenWeightEstimateKg": 50.25,
            },
            {
                "speciesCode": "CRA",
                "greenWeightEstimateKg": 23.75,
            },
            {
                "speciesCode": "HOK",
                "greenWeightEstimateKg": 23.75,
            }
        ],
        "nonFishOrProtectedSpeciesCatches": [
            {
                "speciesCode": "XAF",
                "seabirdCaptureCode": null,
                "estimatedWeightKg": 4,
                "numberUninjured": 4,
                "numberInjured": 1,
                "numberDead": 0,
                "tags": null
            }
        ],
        "tripId": "seiningtrip1",
        "vesselNumber": "1",
        "isVesselUsed": true,
        "eventId": "S0111",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8491346",
        "completedDateTime": "2017-04-30T08:00:00+13:00",
        "notes": "Some notes",
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/seining/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/seining/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "vesselNumber": "123",
    "isVesselUsed": true,
    "eventVersion": 1,
    "notes" : "Some notes",
    "completedDateTime" : null,
    "amendmentReason" : "Catch reported against incorrect stock."
	"tripID": "589"
  },
  "fishingMethodCode": "PS",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["SLE"],
 "startLocation": {
  "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
    "longitude": -175.1025,
    "latitude": -45.9878,
      },
  },
  "isNonFishOrProtectedSpeciesCatchPresent": true,
 
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },
    "catches": [
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 50.25,
    },
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 23.75,
    } 
  ],
   "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "FUG",
      "estimatedWeightKg": 88.88,
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": null
    },
  ]
  "TotalNetLengthAndWarpsMetres": 5,
  "GroundRopeLengthMetres": null,
  "SpotterCallSign": 12345,
  "isSpotterUsed": true,
  "NumberofLifts": null,
  "EstimatedCatchKg": 87.5,
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Jigging Event

The sections below describe the information necessary to create, get and update a Jigging event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
21/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/jigging/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/jigging/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the SJ method must be reported through the jigging Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Deepest Lure Depth Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Bottom Depth Metres Mandatory Number Must be a whole number.

Must be greater than 0.

Number of Single Reels Mandatory Number Must be a whole number.

Must be 0 or greater.

Number of Double Reels Mandatory Number Must be a whole number.

Must be 0 or greater.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "JE0111",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completeddatetime": "2017-04-30T08:00:00+13:00",
    "tripid": "jiggingtrip1"
  },

  "fishingMethodCode": "SJ",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["SLE"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -45.9878,
    }
  },

  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25
    },
    {
      "speciesCode": "CRA",
      "greenWeightEstimateKg": 23.75
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 23.75
    }
    
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
     "speciesCode": "XAF",
      "estimatedWeightKg": 4,
      "numberUninjured": 4,
      "numberInjured": 1,
      "numberDead": 0,
      "tags": null
    }
  ],
  
  "deepestLureDepthMetres": 55,
  "bottomDepthMetres": 44,
  "numberOfSingleReels": 677,
  "numberOfDoubleReels": 986,

}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/jigging/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/jigging/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Deepest Lure Depth Metres Number
Bottom Depth Metres Number
Number of Single Reels Number
Number of Double Reels Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
  "event": {
    "deepestLureDepthMetres": 55,
    "bottomDepthMetres": 44,
    "numberOfSingleReels": 677,
    "numberOfDoubleReels": 986,
    "fishingMethodCode": "SJ",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": [
      "SLE"
    ],
    "startLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": 174.6799,
        "latitude": -41.4289
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": false,
    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25,
      },
      {
        "speciesCode": "CRA",
        "greenWeightEstimateKg": 23.75,
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [
      {
        "speciesCode": "XAF",
        "seabirdCaptureCode": null,
        "estimatedWeightKg": 4,
        "numberUninjured": 4,
        "numberInjured": 1,
        "numberDead": 0,
        "tags": null
      }
    ],
    "tripId": "jiggingtrip1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "JE0111",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8491346",
    "completedDateTime": "2017-04-30T08:00:00+13:00",
    "notes": null,
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/jigging/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/jigging/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "vesselNumber": "123",
    "isVesselUsed": true,
    "eventVersion": 1,
    "notes" : "Some notes",
    "completedDateTime" : null,
    "amendmentReason" : "Catch reported against incorrect stock."
	"tripId": "jiggingtrip1",
  },
  "fishingMethodCode": "SJ",
  "targetSpeciesCode": "SQU",
  "mitigationDeviceCodes": ["SLE"],
 "startLocation": {
  "systemDateTime": "2017-04-01T08:00:00+13:00",
    "systemLocation": {
    "longitude": -175.1025,
    "latitude": -45.9878,
      },
  "manualDateTime": "2017-04-01T08:00:00+13:00",
    "manualLocation": {
    "longitude": -175.1025,
    "latitude": -45.9878,
      }
     },
	 "isNonFishOrProtectedSpeciesCatchPresent": true,
	 
  "finishLocation": {
  "systemDateTime": "2017-01-011T12:30:00+13:00",
    "systemLocation": {
    "longitude": -175.1025,
    "latitude": -45.9878,
      },
  "manualDateTime": "2017-01-01T12:30:00+13:00",
    "manualLocation": {
    "longitude": -175.1025,
    "latitude": -45.9878,
      }
     },
    "catches": [
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 50.25,
    },
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 23.75,
    } 
  ],
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "FUG",
      "estimatedWeightKg": 88.88,
      "numberUninjured": 8,
      "numberInjured": 8,
      "numberDead": 8,
      "tags": null
    },
  ]
  "deepestLureDepthMetres": 55,
  "bottomDepthMetres": 44,
  "numberOfSingleReels": 677,
  "numberofDoubleReels": 986,
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Dredging Event

The sections below describe the information necessary to create, get and update a Dredging event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
21/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
29/05/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/dredging/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/dredging/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

    Content-Type: application/json
    Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
    Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
    Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
    Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Fishing Method Code Mandatory String

Must be a valid fishing method code for the Fishing Event Type.

Validated against Fishing Methods Master Data.

E.g. the D method must be reported through the dredging Fishing Event.

Mitigation Device Codes Optional Array of Strings Validated against the Mitigation Devices master data.
Target Species Code Mandatory String

Must be a valid species.

Validated against the Fish Species master data.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Is Non Fish Or Protected Species Catch Present Mandatory Boolean The Fisher is to state whether or not they have caught any non-fish or protected species.
Dredge Width Metres Conditional Number Decimal to 2dp.

Must be provided if 'Fishing Methods' master data property 'require_dredging_details = true'.

Must be greater than 0.

Fisher can provide for other Methods, ERS will not reject the event if provided.

Number of Tows Completed Conditional Number Must be a whole number.

Must be provided if 'Fishing Methods' master data property 'require_dredging_details = true'.

Must be greater than 0.

Fisher can provide for other Methods, ERS will not reject the event if provided.

Number of Devices Used Mandatory Number Must be a whole number.

Must be greater than 0.

Estimated Catch Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater.

If estimated catch > 0, then Catch must be provided.

If estimated catch = 0 and Catch is provided, ERS will still accept the event.

Finish Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Location when net(s) on deck.

Catches Optional Array of Catches Can be 0 or many Catch records.

Records all species caught

See Catches Parameters below.

Non Fish or Protected Species Catches Conditional Array of NFPS records Can have zero or many NFPS records.

Must have at least one if 'Is Non Fish Or Protected Species Catch Present' is True.

If 'Is Non Fish Or Protected Species Catch Present' is False and NFPS catch provided, ERS will accept the event.

See Non Fish or Protected Species Catches Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided.

See geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String

Must be a valid ERS species code.

Validated against Fish Species master data.

Green Weight Estimate Kg Mandatory Number Decimal to 2dp.

Must be 0 or greater

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against NFPS master data.

Seabird Capture Details Conditional String Must be provided if 'NFPS' master data property 'is_seabird = true' & 'Fishing Methods' master data property 'require_seabird_capture_details = true'.

Validated againt Seabird Capture Codes master data property 'Seabird_Capture_Code'.

Estimated Weight Kg Conditional Number Decimal to 2dp.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Must be greater than 0.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS Tag Number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": "2017-01-01T12:30:00+13:00",
    "tripID": "123"
   },

  "fishingMethodCode": "D",
  "targetSpeciesCode": "SNA",
  "mitigationDeviceCodes": ["SLE"],
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -45.9878,
    }
  },
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-41.4289"
      }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25
    },
    {
      "speciesCode": "CRA",
      "greenWeightEstimateKg": 23.75
    },
    {
      "speciesCode": "HOK",
      "greenWeightEstimateKg": 23.75
    }
    
  ],

  "dredgeWidthMetres": 55,
  "numberOfTowsCompleted": 44,
  "numberOfDevicesUsed": 677,
  "estimatedCatchKg": 986,

}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/dredging/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/dredging/5ba04c30-c81a-4618-898e-e832da93cf9

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Fishing Method Code String
Mitigation Device Codes Array of Strings
Target Species Code String
Start Location See Geolocation Set Parameters below. Geolocation Set
Is Non Fish Or Protected Species Catch Present Boolean
Dredge Width Metres Number
Number of Tows Completed Number
Number of Devices Used Number
Estimated Catch Kg Number
Finish Location See Geolocation Set Parameters below. Geolocation
Completed Date Time String
Catches See Catches Parameters below. Array of Catches
Non Fish or Protected Species Catches See Non Fish or Protected Species Catches Parameters below. Array of NFPS records
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Location

See Geolocation Parameters below

Geolocation
Manual Location

See Geolocation Parameters below

Geolocation
System Date Time String
Manual Date Time String

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Catches Parameters:

ParameterData Type
Species Code String
Green Weight Estimate Kg Number

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Seabird Capture Details String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

{
  "event": {
    "dredgeWidthMetres": 55,
    "numberOfTowsCompleted": 44,
    "numberOfDevicesUsed": 677,
    "estimatedCatchKg": 986,
    "fishingMethodCode": "D",
    "targetSpeciesCode": "SNA",
    "mitigationDeviceCodes": [
      "SLE"
    ],
    "startLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": -175.5432,
        "latitude": -45.9878
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": 174.6799,
        "latitude": -41.4289
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "isNonFishOrProtectedSpeciesCatchPresent": false,
    "catches": [
      {
        "speciesCode": "SNA",
        "greenWeightEstimateKg": 50.25,
      },
      {
        "speciesCode": "CRA",
        "greenWeightEstimateKg": 23.75,
      },
      {
        "speciesCode": "HOK",
        "greenWeightEstimateKg": 23.75,
      }
    ],
    "nonFishOrProtectedSpeciesCatches": [],
    "tripId": "123",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "f763a44e-101a-a997-6044-74928accf8f6",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8462926",
    "completedDateTime": "2017-01-01T12:30:00+13:00",
    "notes": null,
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/dredging/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/dredging/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

  {
  "eventHeader": {
    "eventId": "f763a44e-101a-a997-6044-74928accf8f6",
    "eventVersion": 2,
    "vesselNumber": "",
    "isVesselUsed": false,
    "notes": "TEST UPDATE - Golden Path",
    "amendmentReason": "Incorrect species codes used.",
    "tripID": "123"
   },

  "fishingMethodCode": "MH",
  "targetSpeciesCode": "HOK",
  "startLocation": {
    "systemDateTime": "2017-04-10T09:15:00+11:00",
    "systemLocation": {
      "longitude": -175.5432,
      "latitude": -44.9878
    }
  },
  "finishLocation": {
      "systemDateTime": "2017-04-10T09:15:00+11:00",
      "systemLocation": {
        "longitude": "174.6799",
        "latitude": "-44.4289"
      }
  },

  "isNonFishOrProtectedSpeciesCatchPresent": false,

    "catches": [
    {
      "speciesCode": "SNA",
      "greenWeightEstimateKg": 50.25
    },
    {
      "speciesCode": "CRA",
      "greenWeightEstimateKg": 23.75
    },
  ],

  "dredgeWidthMetres": 88,
  "numberOfTowsCompleted": 88,
  "numberOfDevicesUsed": 99,
  "estimatedCatchKg": 99

}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Trip Start Event

The sections below describe the information necessary to create, get and update a Trip Start event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
29/06/2017 Updated example message for CREATE and UPDATE.
22/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
09/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-start/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-start/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Person in Charge Mandatory String Must be at least 2 characters.

Maximum of 200 characters allowed.

Start Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String

Must not exist in any other trip start event for the vessel number.

If no vessel used, then must not exist in any other trip start event for the client number.
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation

At least one group of system or manual location parameters must be provided.

See Geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Request Body: Example

{
  "eventHeader": {
    "eventId": "TripStartEvent006",
    "tripId": "t1",
    "completedDateTime": "2017-05-01T08:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes."
  },
  "personInCharge": "Sam Mont",
  "startLocation": {
    "systemDateTime": "2017-05-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": "-175.5423",
      "latitude": "-45.9880"
    },
"manualDateTime": null,
"manualLocation": null
}
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-start/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-start/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Person in Charge String

Start Location

See Geolocation Set Parameters below.

Geolocation Set
Completed Date Time String
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Date Time String
Manual Date Time String

System Location

See Geolocation Parameters below.

Geolocation

Manual Location

See Geolocation Parameters below.

Geolocation

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees


Response Body: Example

{
  "event": {
    "personInCharge": "Sam Mont",
    "startLocation": {
      "systemDateTime": "2017-05-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.5423,
        "latitude": -45.988
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "eventId": "TripStartEvent006",
    "tripId": "t1",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8491346",
    "completedDateTime": "2017-05-01T08:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Some notes",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-start/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-start/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

  {
  "eventHeader": {
    "eventId": "TripStartEvent006",
    "tripId": "t1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventVersion": 1,
    "notes" : "Some additional notes",
    "amendmentReason": "Fix error"
  },

  "personInCharge": "Alan Turing",
  "startLocation": {
      "systemDateTime": "2017-05-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.5423,
        "latitude": -45.9881
      },
      "manualDateTime": null,
      "manualLocation": null
    }
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Trip End Event

The sections below describe the information necessary to create, get and update a Trip End event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
29/06/2017 Updated example message for CREATE and UPDATE.
22/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
09/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-end/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-end/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Person in Charge Mandatory String Must be at least 2 characters.

Maximum of 200 characters allowed.

End Location Mandatory Geolocation Set See Geolocation Set Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String Must not exist in any other trip end event for the vessel number.

If no vessel used, then must not exist in any other trip end event for the client number.

Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided. See Geolocation parameters below.
Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Request Body: Example

{
  "eventHeader": {
    "eventId": "TripEndEvent006",
    "tripId": "t1",
    "completedDateTime": "2017-05-01T08:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes."
  },
  "personInCharge": "Sam Mont",
  "endLocation": {
    "systemDateTime": "2017-05-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": "-175.5423",
      "latitude": "-45.9880"
    }
"manualDateTime": null,
"manualLocation": null }
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-end/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-end/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

Properties are returned within an Event parameter. Please see the example provided.

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Person in Charge String

End Location

See Geolocation Set Parameters below.

Geolocation Set
Completed Date Time String
Errors Array
Amendment Reason String

Geolocation Set Parameters:

ParameterData Type
System Date Time String
Manual Date Time String
System Location

See Geolocation Parameters below.

Geolocation
Manual Location

See Geolocation Parameters below.

Geolocation

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Response Body: Example

{
  "event": {
    "personInCharge": "Sam Mont",
    "endLocation": {
      "systemDateTime": "2017-05-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.5423,
        "latitude": -45.988
      },
      "manualDateTime": null,
      "manualLocation": null
    },
    "eventId": "TripEndEvent006",
    "tripId": "t1",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8491346",
    "completedDateTime": "2017-05-01T08:00:00+13:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Some notes.",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/trip-end/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/trip-end/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": {
    "eventId": "TripEndEvent006",
    "tripId": "t1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventVersion": 1,
    "notes" : "Some additional notes",
    "amendmentReason": "Fix error"
  },
  "personInCharge": "Alan Turing",
  "endLocation": {
      "systemDateTime": "2017-05-01T08:00:00+13:00",
      "systemLocation": {
        "longitude": -175.5423,
        "latitude": -45.9881
      },
      "manualDateTime": null,
      "manualLocation": null
    },
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Non Fish or Protected Species (NFPS) Event

The sections below describe the information necessary to create, get and update a NFPS event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
28/06/2017 Updated NFPS parameter field names from 'Count Injured', 'Count Uninjured' and 'Count Dead' to ''Number Injured', 'Number Uninjured' and 'Number Dead'.
22/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
12/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/non-fish-or-protected-species/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/non-fish-or-protected-species/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
NFPS Catch Location Mandatory Geolocation Set See Geolocation Set Parameters below.
Non Fish or Protected Species Catches Mandatory Array of NFPS catches records See Non Fish or Protected Species Catches Parameters below.

Must provide at least one non fish or protected species catch.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Geolocation Set Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Date Time Mandatory String Date 24 hr + UTC Offset.
Manual Date Time Optional String Date 24 hr + UTC Offset.
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided. See Geolocation parameters below.
Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Non Fish or Protected Species Catches Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Mandatory String Must be a valid species NFPS species code.

Validated against the NFPS master data.

Estimated Weight Kg Conditional Number

Decimal to 2dp.

Must be greater than 0.

Must be provided if 'NFPS' master data property 'measured_by = weight'.

Number Uninjured Conditional Number

Must be a whole number.

Must be provided if 'NFPS' master data property 'measured_by = count'.

At least one of Number Uninjured, Number Injured or Number Dead must be provided.
Number Injured Conditional Number
Number Dead Conditional Number
Tag Optional Array of Strings NFPS tag number.

Request Body: Example

{
  "eventHeader": {
    "eventId": "NFPS111",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "completedDateTime": "2017-03-28T09:15:00+11:00",
    "tripID": "123"
  },

  "nfpsCatchLocation": {
    "systemDateTime": "2017-05-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": "-175.5423",
      "latitude": "-45.9880"
    },
   "manualDateTime": "2017-05-01T08:00:00+13:00",
    "manualLocation": {
      "longitude": "-175.5423",
      "latitude": "-45.9880"
    }
 },
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "ACN",
      "estimatedWeightKg": 182.23,
      "numberUninjured": null,
      "numberInjured": null,
      "numberDead": null,
      "tags": null
    },
    {
      "speciesCode": "atp",
      "estimatedWeightKg": 1.4,
      "numberUninjured": 2,
      "numberInjured": 3,
      "numberDead": 5,
      "tags": ["SG101", "SG105", "SG305", "SG501", "SG111"]
    }
  ]

}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/non-fish-or-protected-species/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/non-fish-or-protected-species/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String

NFPS Catch Location

See Geolocation Set Parameters below.

Geolocation Set
Completed Date Time String
Errors Array
Amendment Reason String

Non Fish or Protected Species Catches

See Non Fish or Protected Species Catches Parameters below.

Array of NFPS catches records

Geolocation Set Parameters:

ParameterData Type
System Date Time String
Manual Date Time String

System Location

See Geolocation Parameters below.

Geolocation

Manual Location

See Geolocation Parameters below.

Geolocation

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Non Fish or Protected Species Catches Parameters:

ParameterData Type
Species Code String
Estimated Weight Kg Number
Number Uninjured Number
Number Injured Number
Number Dead Number
Tag Array of Strings

Response Body: Example

  {
    "event": {
        "nfpsCatchLocation": {
            "systemDateTime": "2017-05-01T08:00:00+13:00",
            "systemLocation": {
                "longitude": -175.5423,
                "latitude": -45.988
            },
            "manualDateTime": "2017-05-01T08:00:00+13:00",
            "manualLocation": {
                "longitude": -175.5423,
                "latitude": -45.988
            }
        },
        "nonFishOrProtectedSpeciesCatches": [
            {
                "speciesCode": "ACN",
                "seabirdCaptureCode": null,
                "estimatedWeightKg": 182.23,
                "numberUninjured": null,
                "numberInjured": null,
                "numberDead": null,
                "tags": null
            },
            {
                "speciesCode": "atp",
                "seabirdCaptureCode": null,
                "estimatedWeightKg": 1.4,
                "numberUninjured": 2,
                "numberInjured": 3,
                "numberDead": 5,
                "tags": [
                    "SG101",
                    "SG105",
                    "SG305",
                    "SG501",
                    "SG111"
                ]
            }
        ],
        "tripId": "123",
        "vesselNumber": "1",
        "isVesselUsed": true,
        "eventId": "NFPS111",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8491346",
        "completedDateTime": "2017-03-28T09:15:00+11:00",
        "notes": null,
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/non-fish-or-protected-species/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/non-fish-or-protected-species/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

  
{
  "eventHeader": {
    "eventId": "NFPS1",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventVersion": 1,
    "tripID": "TS1",
    "amendmentReason": "Estimated weight for ACN recorded incorrectly",
    "notes":"NFPS Update"
  },

  "nfpsCatchLocation": {
    "systemDateTime": "2017-05-01T08:00:00+13:00",
    "systemLocation": {
      "longitude": "-166.5423",
      "latitude": "-44.9880"
    },
   "manualDateTime": "2017-05-01T08:00:00+13:00",
    "manualLocation": {
      "longitude": "-155.5423",
      "latitude": "-44.9880"
    }
 },
  "nonFishOrProtectedSpeciesCatches": [
    {
      "speciesCode": "ACN",
      "estimatedWeightKg": 187.23,
      "numberUninjured": null,
      "numberInjured": null,
      "numberDead": null,
      "tags": null
    },
    {
      "speciesCode": "ATP",
      "estimatedWeightKg": 1.4,
      "numberUninjured": 2,
      "numberInjured": 3,
      "numberDead": 5,
      "tags": ["SG101", "SG105", "SG305", "SG501", "SG111"]
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Processing Event

The sections below describe the information necessary to create, get and update a Processing event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
22/06/2017 Trip ID field added to the API actions CREATE, GET and UPDATE. Schema Edition and Event Version fields added to the API action GET. Some field name changes. Grouping of locations and dates into Geolocation Set Parameters and Geolocation Parameters.
12/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/processing/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/processing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Processing Date Time Mandatory String Date 24hr + UTC offset.
Oil Litres Optional Number Must be a whole number.

Must be 0 or greater.

Products Mandatory Array of Products Must have at least one product record.

Can have many products associated with a processing event.

Species details are also recorded against each product.

See Products Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Products Parameters Array:

ParameterRequiredData TypeValidation and Additional Notes
Product State Code Mandatory String

Must be a valid ERS product state code.

Validated against product-states master data.

Must have at least one Product State for a Processing event.

Species Conditional Array of species If Product States master data property 'allow_multiple_fish_codes' = 'True' then one or more species codes may be supplied within the species array.

Else, only one species code may be supplied within the species array.

See Species Parameters Array below.

Container Type Code Mandatory String Must be a valid ERS container type code.

Validated against containers master data.

Estimated Container Weight Kg Mandatory Number Decimal to 2dp.

Must be greater than 0.

Per container.

Container Count Mandatory Number Must be a whole number.

Must be greater than 0.

Total number of containers associated with the container type code.

Conversion Factor Conditional Number Decimal to 2dp.

Must be provided if 'Product States' master data property 'require_conversion_factor' = 'True' and must equal (in hierarchical order) one of the following:

  • Species-specific CF; else,
  • Species Category-specific CF

NOTE: If a Species/Product State combination supplied has a NULL CF in the Species-specific CF table, then combination of Species and Product State is an invalid one.

Species Parameters Array:

ParameterRequiredData TypeValidation and Additional Notes
Species Code Conditional String Must be a valid ERS species code.

Validated against Fish Species Master Data.

Green Weight Kg Conditional Number Decimal to 2dp.

Must be provided and greater than '0' if 'Product States' master data property 'require_greenweight' = 'True'.

Otherwise, must not be provided.

Request Body: Example

{
  "eventHeader": {
    "eventId": "256",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes",  
    "completedDateTime": "2017-05-17T15:34:12+13:00",
    "tripID": "123"
  },
  "processingDateTime": "2017-05-17T15:34:12+13:00",
  "oilLitres": 98,
  "products": [
    {
                "productStatecode": "DRE",
                "species": [ {"SpeciesCode":"KIN",
                "GreenWeightKg":25.5}
               
                                ],
                "containerTypecode": "BAG",
                "containerCount": 2,
                "estimatedContainerWeightKg": 12.3,
                "conversionFactor": 1.6
    },
    {
                "productStateCode": "FIT",
                                "species": [ 
                                  {
                                "speciesCode": "KIN",
                                "greenWeightKg": null
                  }
                                ],
                "containerTypeCode": "SAC",
                "containerCount": 14,
                "estimatedContainerWeightKg": 99.9,
                "conversionFactor": null
    }

  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/processing/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/processing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Processing Date Time String
Completed Date Time String
Errors Array
Amendment Reason String
Oil Litres Number

Products

See Products Parameters below.

Array of Products

Products Parameters Array:

ParameterData Type
Product State Code String
Species

See Products Parameters below.

Array of Species
Container Type Code String
Estimated Container Weight Kg Number
Container Count Number
Conversion Factor Number

Species Parameters Array:

ParameterData Type
Species Code String
Green Weight Kg Number

Response Body: Example

{
  "event": {
    "processingDateTime": "2017-05-17T15:34:12+13:00",
    "oilLitres": 98,
    "products": [
      {
        "productStateCode": "DRE",
        "species": [
          {
            "speciesCode": "KIN",
            "greenWeightKg": 25.5
          }
        ],
        "containerTypeCode": "BAG",
        "estimatedContainerWeightKg": 12.3,
        "containerCount": 2,
        "conversionFactor": 1.6
      },
      {
        "productStateCode": "FIT",
        "species": [
          {
            "speciesCode": "KIN",
            "greenWeightKg": null
          }
        ],
        "containerTypeCode": "SAC",
        "estimatedContainerWeightKg": 99.9,
        "containerCount": 14,
        "conversionFactor": null
      }
    ],
    "tripId": "123",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "eventId": "256abc",
    "schemaEdition": 1,
    "eventVersion": 1,
    "clientNumber": "8462926",
    "completedDateTime": "2017-05-17T15:34:12+13:00",
    "notes": "Some notes",
    "amendmentReason": null
  },
  "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/processing/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/processing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number The version of the event that the fisher is wanting to update.

Request Body: Example

 
{
  "eventHeader": {
    "eventId": "256abc",
    "eventVersion": 1,
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes" : "Some notes",  
    "amendmentReason": "mistake in original",
    "tripID": "123"
  },
  "processingDateTime": "2017-06-17T15:34:12+13:00",
  "oilLitres": 98,
  "products": [
    {
                "productStatecode": "DRE",
                "species": [ {"SpeciesCode":"KIN",
                "GreenWeightKg":25.5}
               
                                ],
                "containerTypecode": "BAG",
                "containerCount": 2,
                "unitWeightKg": 4.5,
                "estimatedContainerWeightKg": 12.3,
                "conversionFactor": 1.6
    },
    {
                "productStateCode": "FIT",
                                "species": [ 
                                  {
                                "speciesCode": "KIN",
                                "greenWeightKg": null
                  }
                                ],
                "containerTypeCode": "SAC",
                "containerCount": 14,
                "estimatedContainerWeightKg": 99.9,
                "conversionFactor": null
    }

  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Disposal Event

The sections below describe the information necessary to create, get and update a Disposal event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
29/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/disposal/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/disposal/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Disposal Date Time Mandatory String Date 24hr + UTC offset.
At Sea Holding Receptacle Location Conditional Basic GeoLocation Set

Must be provided if 'Disposal Codes' master data property 'require_holding_location = yes'.

At least one group of system or manual location parameters must be provided.

See At Sea Holding Receptacle Location Parameters below.

Stocks Disposed Mandatory Array of Stocks Disposed Must provide at least one disposal stock.

See Stocks Disposed Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Mandatory String

Must be a valid Vessel number.

Must be provided if 'Is Vessel Used' = True.

Must be provided if 'Fishing Methods' master data property 'require_vessel_number = true'.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

At Sea Holding Receptacle Location Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Location Conditional Geolocation At least one group of system or manual location parameters must be provided. See Geolocation parameters below.
Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Stocks Disposed Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Stock Code Mandatory String Must be a valid Stock code.

Validated against Fish Stock Master Data.

Disposal Code Mandatory String Must be a valid Disposal code.

Validated against Disposal Codes Master Data.

Estimated Green Weight Kg Mandatory Number Decimal to 2dp.

Must be be greater than 0.

Request Body: Example

{
  "eventHeader": {
    "eventId": "5ba04c30-c81a-4618-898e-e832da93cf91",
    "tripId": "DE-1",
    "completedDateTime": "2017-03-28T09:15:00+11:00",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Disposal Golden Path - TEST"
  },
  "DisposalDateTime": "2017-03-28T09:15:00+11:00",
  "atSeaHoldingReceptacleLocation": {
        "manualLocation": {
          "longitude": "-175.11111",
          "latitude": "-44.2222"
        },
        "systemLocation": {
          "longitude": "-175.3333",
          "latitude": "-45.4444"
        }
      },
  "stocksDisposed": [
    { 
      "stockCode" : "HOK1",
      "disposalCode": "H",
      "estimatedGreenWeightKg" : 2
    },
    { 
      "stockCode" : "CAR1",
      "disposalCode": "d",
      "estimatedGreenWeightKg" : 1
    }
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/disposal/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/disposal/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Completed Date Time String
Disposal Date Time String
At Sea Holding Receptacle Location

See At Sea Holding Receptacle Location Parameters below.

Basic Geolocation Set
Errors Array
Amendment Reason String

Stocks Disposed

See Stocks Disposed Parameters below.

Array of Stocks Disposed

At Sea Holding Receptacle Location Parameters:

ParameterData Type

System Location

See Geolocation Parameters below.

Geolocation

Manual Location

See Geolocation Parameters below.

Geolocation

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees

Stocks Disposed Parameters:

ParameterData Type
Stock Code String
Disposal Code String
Estimated Green Weight Kg Number

Response Body: Example

{
    "event": {
        "disposalDateTime": "2017-03-28T09:15:00+11:00",
        "atSeaHoldingReceptacleLocation": {
            "systemLocation": {
                "longitude": -175.3333,
                "latitude": -45.4444
            },
            "manualLocation": {
                "longitude": -175.11111,
                "latitude": -44.2222
            }
        },
        "stocksDisposed": [
            {
                "stockCode": "HOK1",
                "disposalCode": "H",
                "estimatedGreenWeightKg": 2
            },
            {
                "stockCode": "CAR1",
                "disposalCode": "d",
                "estimatedGreenWeightKg": 1
            }
        ],
        "tripId": "DE-1",
        "vesselNumber": "1",
        "isVesselUsed": true,
        "eventId": "12345",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8462926",
        "completedDateTime": "2017-03-28T09:15:00+11:00",
        "notes": "Disposal Golden Path - TEST",
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/disposal/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/disposal/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number The version of the event that the fisher is wanting to update.

Request Body: Example

 
{
  "eventHeader": {
    "eventId": "12345",
    "eventVersion": 1,
    "tripId": "DE-2",
    "amendmentReason": "estimated green weight for CAR1 was wrong",
    "vesselNumber": "1",
    "isVesselUsed": true,
    "notes": "Disposal Update - TEST"
  },
  "DisposalDateTime": "2017-03-28T09:15:00+11:00",
  "atSeaHoldingReceptacleLocation":{
        "manualLocation": {
          "longitude": "-175.4444",
          "latitude": "-45.1111"
        },
        "systemLocation": {
          "longitude": "-175.33333",
          "latitude": "-45.2222"
        }
      },
  "stocksDisposed": [
    { 
      "stockCode" : "HOK1",
      "disposalCode": "d",
      "estimatedGreenWeightKg" : 11
    },
    { 
      "stockCode" : "CAR1",
      "disposalCode": "d",
      "estimatedGreenWeightKg" : 17
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

Landing Event

The sections below describe the information necessary to create, get and update a Landing event.

Change history
Date Change
28/07/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/landing/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/landing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Landing Date Time Mandatory String Date 24hr + UTC offset.
Is Green Weight Details Complete Mandatory Boolean

Once set to 'True' in a submission, subsequent submissions should not be set to 'False'. ERS will reject the event if 'False'.

Set this to yes (true) if you are providing all of the green weight details. Set this to no (false) if you are providing the initial landing report, with container weights and counts but don’t yet have the green weight details from the LFR.

Green Weight Details Completed Date Time Conditional String

Date 24hr + UTC offset.

Must not be provided if 'Is Green Weight Details Complete' = false.

Must be provided when 'Is Green Weight Details Complete' = true.

Must not be provided on subsequent amendments, after the event is accepted with 'Green Weight Details Complete' = true.

The logbook must populate this value systematically (no user override) when the user first sets "Green Weight Details Complete?" to Yes and completes the event report. After setting it initially the logbook must not reset it.

Landings Mandatory Array of landings Must have at least one landing record.

Can have many landings associated with the event.

Product details are also recorded against each landing.

See Landings Parameters below.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Must be unique for the event.

Log book generated unique identifier.

Trip ID Mandatory String
Is Vessel Used Mandatory Boolean Identifies if the fishing took place on a vessel or not.
Vessel Number Conditional String Mandatory if 'Is Vessel Used' = True.

Must be a valid Vessel number.

If 'Is Vessel Used' = False and Vessel Number provided, ERS will not accept the event.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Mandatory String

Date 24hr + UTC offset.

Must be provided for Create.

Must be null for Update. ERS will not accept the event if provided for update.

The date and time when the event data was completed in the Logbook. That is, when the status was set to “Complete”.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Landings Parameters Array:

ParameterRequiredData TypeValidation and Additional Notes
Landing Code Mandatory String

Must be a valid ERS landing code.

Validated against Landing Codes master data.

Must not be provided if 'Landing Codes' master data property 'is_greenweight_complete_must_be_false = true'.

LFR Client Number Conditional String

Must be a valid Client number.

Must be provided if 'Landing Codes' master data property 'require_LFR_number = true'.

Holding Receptable Location Conditional< Basic GeoLocation Set

Must be provided if 'Landing Codes' master data property 'require_holding_location = true'.

At least one group of system or manual location parameters must be provided if 'Address' is not provided.

See Holding Receptacle Location Parameters below.

Holding Receptacle Address Conditional String

Must be provided if one group of system or manual location parameters are not provided.

Maximum of 500 characters allowed.

Tranship Vessel Number Conditional String

Must be provided if 'Landing Codes' master data property 'require_vessel_number = true'.

Must be a valid vessel number.

Customary Fishing Document Reference Conditional String Must be provided if 'Landing Codes' master data property 'require_customary_reference = true'.
Is Offal Mealed Optional Boolean Indicates if the offal has been processed as fish meal.
Oil Litres Optional Number

Must be a whole number.

Must be greater than 0.

Landing Products Mandatory Array of landing products Must have at least one product record.

See Landing Products Parameters below.

Holding Receptacle Location Parameters:

ParameterRequiredData TypeValidation and Additional Notes
System Location Conditional Geolocation

At least one group of system or manual location parameters must be provided.

See Geolocation parameters below.

Manual Location Conditional Geolocation

Geolocation Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Latitude Mandatory decimal degrees, 4dp Minimum of 4dp required.
Longitude Mandatory decimal degrees, 4dp Minimum of 4dp required.

Landing Products Parameters Array:

ParameterRequiredData TypeValidation and Additional Notes
Product State Code Mandatory String

Must be a valid ERS product state code.

Validated against Product States master data.

Container Type Code Mandatory String

Must be a valid ERS container type code.

Validated against Containers master data.

Estimated Container Weight Mandatory Number

Decimal to 2dp.

Must be greater than 0.

Container Count Mandatory Number

Must be a whole number.

Must be greater than 0.

Total number of containers associated with the container type code.

Purchase Order Number Conditional String

Must be provided if 'Landing Codes' master data property 'require_purchase_order = true' and 'Is Green Weight Details Complete' = true.

Maximum of 50 characters allowed.

Stocks Conditional Array of stocks

Must have at least one stock record.

Multiple stocks allowed if 'Product States' master data property 'allow_multiple_fish_codes' = true.

>See Stocks Parameters Array below.

Stocks Parameters Array:

ParameterRequiredData TypeValidation and Additional Notes
Stock Code Conditional String

Must be a valid ERS stock code.

Validated against Fish Stock master data.

Green Weight Kg Conditional Number

Decimal to 2dp.

Must be provided and greater than '0' if 'Product States' master data property 'require_greenweight' = true and 'Is Green Weight Details Complete' = true.

Otherwise, must not be provided.
Shark Fins Weight Kg Conditional Number

Decimal to 2dp.

Must be provided and greater than 0 if 'Product States' master data property 'require_shark_fin_weight' = true and 'Is Green Weight Details Complete' = true.

Otherwise, must not be provided.

Request Body: Example

 {
  "eventHeader": 
  {
    "eventId": "abcdef",
    "tripId": "TR1",
    "completedDateTime": "2017-07-27T09:15:00+11:00",
    "vesselNumber": "15527",
    "isVesselUsed": true,
    "notes": "Test notes"
  },
  "LandingDateTime": "2017-10-28T09:15:00+11:00",
  "isGreenWeightDetailsComplete": false,
  "greenWeightDetailsCompletedDateTime": null,
  "landings": [
  {  
    "landingCode": "Q",
    "lfrClientNumber": null,
    "holdingReceptacleAddress": null,
    "holdingReceptacleLocation":
    {
    "manualLocation": 
     {
      "longitude": "-175.5432",
      "latitude": "-45.9878"
     },
    "systemLocation": 
     {
      "longitude": "-175.5432",
      "latitude": "-45.9878"
     }
    },
      "transhipVesselNumber": null,
      "customaryFishingDocumentReference": null,
      "isOffalMealed": true,
      "oilLitres": 143,
      "landingProducts": [
      {
      "productStateCode": "DSC",   
      "containerTypeCode": "BIN",
      "estimatedContainerWeightKg": 22.22,
      "containerCount": 7,
      "purchaseOrderNumber": null,
      "stocks": [
       { 
        "stockCode" : "HOK1",
        "greenWeightKg" : 20.12
       }
          ]
        }
      ]
    }
  ]
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/landing/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/landing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

ParameterData Type
Event ID String
Trip ID String
Schema Edition Number
Event Version Number
Is Vessel Used Boolean
Vessel Number String
Notes String
Completed Date Time String
Landing Date Time String
Is Green Weight Details Complete Boolean
Green Weight Details Completed Date Time String
Landings Array of landings
Errors Array
Amendment Reason String

Landings Parameters Array:

ParameterData Type
Landing Code String
LFR Client Number String

Holding Receptacle Location

See Holding Receptacle Location Parameters below.

Basic GeoLocation Set
Holding Receptacle Address String
Tranship Vessel Number String
Customary Fishing Document Reference String
Is Offal Mealed Boolean
Oil Litres Number
Landing Products Array of landing products

Holding Receptacle Location Parameters:

ParameterData Type

System Location

See Geolocation Parameters below.

Geolocation

Manual Location

See Geolocation Parameters below.

Geolocation

Geolocation Parameters:

ParameterData Type
Latitude decimal degrees
Longitude decimal degrees


Landing Products Parameters Array:

ParameterData Type
Product State Code String
Container Type Code String
Estimated Container Weight Number
Container Count Number
Purchase Order Number String
Stocks Array of stocks

Stocks Parameters Array:

ParameterData Type
Stock Code String
Green Weight Kg Number
Shark Fins Weight Kg Number

Response Body: Example

{
    "event": {
        "landingDateTime": "2017-10-28T09:15:00+11:00",
        "landings": [
            {
                "landingCode": "Q",
                "oilLitres": 143,
                "lfrClientNumber": null,
                "holdingReceptacleLocation": {
                    "systemLocation": {
                        "longitude": -175.5432,
                        "latitude": -45.9878
                    },
                    "manualLocation": {
                        "longitude": -175.5432,
                        "latitude": -45.9878
                    }
                },
                "holdingReceptacleAddress": null,
                "transhipVesselNumber": null,
                "landingProducts": [
                    {
                        "productStateCode": "DSC",
                        "stocks": [
                            {
                                "stockCode": "HOK1",
                                "greenWeightKg": 99.54,
                                "sharkFinsWeightKg": null
                            }
                        ],
                        "containerTypeCode": "BIN",
                        "estimatedContainerWeightKg": 22.22,
                        "containerCount": 7,
                        "purchaseOrderNumber": null
                    }
                ]
            }
        ],
        "tripId": "TR1",
        "vesselNumber": "15527",
        "isVesselUsed": true,
        "eventId": "abcdef",
        "schemaEdition": 1,
        "eventVersion": 2,
        "clientNumber": "8462926",
        "completedDateTime": "2017-07-27T09:15:00+11:00",
        "eventDateTime": "0001-01-01T00:00:00+00:00",
        "notes": "Test notes",
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/landing/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/landing/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeDescription
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameters.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeDescription
Event Version Mandatory Number

The version of the event that the fisher is wanting to update.

Can only update the latest version of an event.

Request Body: Example

{
  "eventHeader": 
  {
    "eventId": "abcdef",
    "tripId": "TR1",
    "eventVersion": 1,
    "completedDateTime": null,
    "vesselNumber": "15527",
    "isVesselUsed": true,
    "notes": "Test notes",
    "amendmentReason": "updating greenweight details"
  },
  "LandingDateTime": "2017-10-28T09:15:00+11:00",
  "isGreenWeightDetailsComplete": true,
  "greenWeightDetailsCompletedDateTime": "2017-11-04T09:15:00+11:00",
  "landings": [
  {  
    "landingCode": "Q",
    "lfrClientNumber": null,
    "holdingReceptacleAddress": null,
    "holdingReceptacleLocation":
    {
    "manualLocation": 
     {
      "longitude": "-175.5432",
      "latitude": "-45.9878"
     },
    "systemLocation": 
     {
      "longitude": "-175.5432",
      "latitude": "-45.9878"
     }
    },
      "transhipVesselNumber": null,
      "customaryFishingDocumentReference": null,
      "isOffalMealed": true,
      "oilLitres": 143,
      "landingProducts": [
      {
      "productStateCode": "DSC",   
      "containerTypeCode": "BIN",
      "estimatedContainerWeightKg": 22.22,
      "containerCount": 7,
      "purchaseOrderNumber": null,
      "stocks": [
       { 
        "stockCode" : "HOK1",
        "greenWeightKg" : 99.54
       }
          ]
        }
      ]
    }
  ]
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeDescription
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeDescription
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top

No Activity Event

The sections below describe the information necessary to create, get and update a No Activity event.

Change history
Date Change
05/07/2017 Changed the way we display the event header parameters in this API documentation. All parameters that are used in the event header array were moved from the Request Body Parameters table to a new Event Header Parameters table. This better reflects their use as displayed in the Request Body Example. No parameter names were changed and the current API format was not changed.
29/06/2017 Initial publication

Create

Request URL:

POST https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/no-activity/{eventID}

Example:

POST https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/no-activity/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

ParameterRequiredData TypeValidation and Additional Notes
Event Header Mandatory Event Header Set See Event Header Properties below.
Operator of Vessel Mandatory Boolean If 'No', Vessel Number must be NULL, otherwise invalid 'Operator of Vessel'.

Yes / No.

Vessel Number Conditional Array of vessel numbers Mandatory if 'Operator of Vessel' = Yes.

Must be a valid Vessel Number.

If Vessel Number is provided with no Operator of Vessel, invalid 'Operator of vessel is false and vessel number is provided'.

Multiple vessel numbers can be provided.

No Activity Date Time Mandatory String Date 24hr + UTC offset.

Must be the 1st of the month.

Event Header Properties:

ParameterRequiredData TypeValidation and Additional Notes
Event ID Mandatory String Unique logbook generated ID for an event.

The same event ID as defined in the URL.

Notes Optional String The Fisher may record additional information relating to the event.
Completed Date Time Conditional String Must be provided for Create. Must be null for Update. ERS will not accept the event if provided for update.

Date 24hr + UTC offset.

Amendment Reason Conditional String Must be provided for Update.

Must be null for Create. ERS will not accept the event if provided for create.

Request Body: Example

{
  "eventHeader": {
    "eventId": "no21",
    "completedDateTime": "2017-04-01T12:30:00+13:00"
  },
  "operatorOfVessel": true,
  "vesselNumbers": ["1","100"],
  "noActivityDateTime":  "2017-03-01T09:15:00+11:00"
}

Response

Response Status:

StatusDescription
201 Created Status when event has been accepted successfully.
400 Bad Request Status when there are missing headers, missing event parameters, duplicate event ID.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

The following example of the response body is returned when there are no errors and the event is accepted (Status Code – 201).

{
 "errors": []
}

Example 2:

The following example of the response body is returned when there are errors and the event is rejected (Status Code – 400).

{
  "errors": [
    {
      "propertyName": "EventId",
      "attemptedValue": "5ba04c30-c81a-4618-898e-e832da93cf91",
      "errorCode": "DuplicateValue",
      "errorMessage": "EventId already exists."
    }
  ]
}

Get

Request URL:

GET https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/no-activity/{eventID}

Example:

GET https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/no-activity/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Response

Response Status:

StatusDescription
200 Ok Status when event has been retrieved successfully.
404 Not Found Status when event cannot be found.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Body Parameters:

Properties are returned within an Event parameter. Please see the example provided.

ParameterData Type
Event ID String
Schema Edition Number
Event Version Number
Operator of Vessel Boolean
Vessel Number Array of vessel numbers
Notes String
Completed Date Time String
No Activity Date Time String
Errors Array
Amendment Reason String

Response Body: Example

{
    "event": {
        "noActivityDateTime": "2017-03-01T09:15:00+11:00",
        "operatorOfVessel": true,
        "vesselNumbers": [
            "1",
            "100"
        ],
        "eventId": "no21",
        "schemaEdition": 1,
        "eventVersion": 1,
        "clientNumber": "8462926",
        "completedDateTime": "2017-04-01T12:30:00+13:00",
        "notes": null,
        "amendmentReason": null
    },
    "errors": []
}

Update

Request URL:

PUT https://ers.demo.kupe.fishserve.co.nz/api/{clientNumber}/event/v1/no-activity/{eventID}

Example:

PUT https://ers.demo.kupe.fishserve.co.nz/api/1234567/event/v1/no-activity/5ba04c30-c81a-4618-898e-e832da93cf91

Create URL Parameters:

ParameterRequiredData typeValidation and Additional Notes
Client Number Mandatory String The main permit holder client number that the event is submitted against.
Event ID Mandatory String Unique logbook generated ID for an event.

Request Header:

Content-Type: application/json
Software-Vendor: YOUR_SOFTWARE_VENDOR_NAME (For example, elogbook) 
Software-Version: YOUR_SOFTWARE_VERSION_NUMBER (For example, 1.0.0.0)
Software-Installation-Id: YOUR_SOFTWARE_INSTALLATION_ID (Optional) (For example, a13afab2-c409-4622-b8f8-146996587809)
Authorization: Bearer YOUR_USER_TOKEN

Request Body Parameters:

The request body parameters includes all those fields that have been defined in the create event and the following additional parameter.

This parameter is a property of the Event Header Set.

The amended value of the fields that need to be updated will be passed in the request body.

ParameterRequiredData TypeValidation and Additional Notes
Event Version Mandatory Number The version of the event that the fisher is wanting to update.

Request Body: Example

 
{
  "eventHeader": {
    "eventId": "no21",
    "eventVersion": 1,
    "notes": "these are the notes",
    "amendmentReason": "to add notes",
    "completedDateTime": null
  },
  "operatorOfVessel": true,
  "vesselNumbers": ["1"],
  "noActivityDateTime":  "2017-03-01T09:15:00+11:00"
}

Response

Response Status:

StatusDescription
200 Ok Status when event has been updated successfully.
400 Bad Request Status when event failed to update. This can be as a result of the event version not matching the correct version of the message in the update request or missing headers, missing event parameters.
401 Unauthorised Status when the user does not have the appropriate authorisation to perform the action.

Response Parameters:

The response parameters includes all the fields that have been included in the request body and the following additional parameters.

ParameterData TypeValidation and Additional Notes
Errors Array List of errors, if any. See Errors Parameters below.

Errors Parameters:

ParameterData TypeValidation and Additional Notes
Property Name String The name of the property that has an error.
Attempted Value String The attempted value used.
Error Code String The type of error.
Error Message String The description of the error.

Example 1:

{
 "errors": []
}

Example 2:

{
  "errors": [
  {
   "propertyName": "EventVersion",
   "attemptedValue": "2",
   "errorCode": "InvalidValue",
   "errorMessage": "You are not amending the most recent version for this event. Please get the latest version and try again."
  }
 ]
}

Back to top