Page tree

Versions Compared

Key

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

...

Code Block
languagebash
curl 'https://www.barentswatch.no/bwapi/v3/geodata/fishingfacilitychange/deployed' \
-H 'Content-Type: application/json;charset=utf-8' \
-H 'Authorization: bearer <token>' \
--data-raw '{
  "toolId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "toolTypeCode": "NETS",
  "geometry": {"type":"Point","coordinates":[30,10]},
  "setupTime": "2021-12-13T09:49:56.607Z",
  "toolCount": 15
}'

...

Code Block
languagebash
curl --location --request POST 'https://id.barentswatch.no/connect/deviceauthorization' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=MyClientId' \
--data-urlencode 'scope=api offline_access' \
--data-urlencode 'client_secret=MyClientSecret123'


Response:

Code Block
languagejs
{
"device_code": "HuF-7KISrXG0huI-RoqVdnba9d92zzn3hkEuN86hNeg",
"user_code": "788578139",
"verification_uri": "https://id.barentswatch.no/device",
"verification_uri_complete": "https://id.barentswatch.no/device?userCode=788578139",
"expires_in": 3600,
"interval": 5
}

...

Code Block
curl --location --request POST 'https://id.barentswatch.no/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=MyClientId' \
--data-urlencode 'client_secret=MyClientSecret123' \
--data-urlencode 'device_code=HuF-7KISrXG0huI-RoqVdnba9d92zzn3hkEuN86hNeg' \
--data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:device_code'

...

Code Block
curl --location --request POST 'https://id.barentswatch.no/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'refresh_token=y255GMDNpgn12345UiNQkAYd1cZL-sqmfhjM7xS9bGY' \
--data-urlencode 'client_id=MyClientId' \
--data-urlencode 'client_secret=MyClientSecret123' \
--data-urlencode 'grant_type=refresh_token'

...