Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here are a few example requests for the FiskInfo FishInfo Reporting API.

To get the appropriate permissions for your client to use device flow you have to contact us by mail.

1. Get profile

Code Block
languagebash
curl 'https://www.barentswatch.no/bwapi/v3/geodata/fishingfacilityprofile' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: bearer <access_token>'

...

"haveProfile" must be true to send reports. The user can only send reports for the vessel in the profile.



2. Get reports and tools for the user


Code Block
languagebash
curl 'https://www.barentswatch.no/bwapi/v3/geodata/fishingfacilitychanges' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: bearer <access_token>'

...

Failed reports: Reports that were not sent to KVS because they failed. This should normally not happen.


3. Report a tool as retrieved


This should be one of the tools from confirmed_tools list from the fishingfacilitychanges-endpoint:

...

After sending a report, the client should refresh the data from the fishingfacilitychanges-endpoint.


4. Report a new tool as deployed


To report a new tool as deployed:

...

After sending a report, the client should refresh the dta from the fishingfacilitychanges-endpoint.



Device login

Login with a client that is set up with device flow.

1. Start login

When a user wants to log in, the device should make a request to the deviceauthorization endpoint:

...

interval (seconds) is the shortest interval that the device can poll the token endpoint.


2. Poll for token

Now the device can poll every 5 seconds (the interval value) for the token:

...

Expires_in (seconds) is expiration time for the access_token (1 hour).


Refresh tokens

When the access token expires, the tokens can be refreshed using the refresh_token:

...