-
Notifications
You must be signed in to change notification settings - Fork 7
API Specification
Mark Lisé edited this page Dec 14, 2023
·
6 revisions
Note: All api calls require setting of the header Authorization: None. Non-sysadmins (3rd party subscribers) cannot search for pending records.
GET /api/config (Get Web Configuration)
None
None
http code content-type 200application/json
Show example response
{ "code": 200, "data": { "KEYCLOAK_URL": "https://dev.loginproxy.gov.bc.ca/auth", "KEYCLOAK_ENABLED": true, "KEYCLOAK_REALM": "bcparks-service-transformation", "KEYCLOAK_CLIENT_ID": "data-register", "API_KEY": <API KEY>, "ENVIRONMENT": "dev", "configEndpoint": true, "logLevel": 0, "sk": "config", "API_LOCATION": "https://zloys5cfvf.execute-api.ca-central-1.amazonaws.com", "pk": "config", "API_PATH": "/api" }, "msg": "Success", "error": null }
curl "https://dev-data.bcparks.ca/api/config -H "accept: application/json"
GET /api/parks/names (Get All Park Name information)
Note: At least one of the below parameters are required: Choose either 'status' or 'legalName'.
name type data type description legalName optional string Provide text to search across the entire database status optional string Comma separated list of statuses: established,pending,repealed
name type data type description Authorization required string Use the string Nonex-api-key required string Provide the api key given to you by the data register team
http code content-type 200application/json
curl "https://dev-data.bcparks.ca/api/parks/names?legalName=Golden Ears Park" -H "authorization: None" -H "accept: application/json" -H "x-api-key: <YOUR_API_KEY>"
GET /api/parks/{identifier}/name (Get Specific Park Name information)
Substitute {identifier} with either 0-prefixed numbers, or non-zero prefixed numbers. e.g. 0001 is equivalent to 1
name type data type description status optional string Comma separated list of statuses: established,pending,repealed
name type data type description Authorization required string Use the string Nonex-api-key required string Provide the api key given to you by the data register team
http code content-type 200application/json
curl "https://dev-data.bcparks.ca/api/parks/0001/name?status=established" -H "authorization: None" -H "accept: application/json" -H "x-api-key: <YOUR_API_KEY>"
PUT /api/parks/{identifier}/name (Update Specific Park Name information)
Substitute {identifier} with either 0-prefixed numbers, or non-zero prefixed numbers. e.g. 0001 is equivalent to 1
name type data type description updateType required string Choose one of the following: major,minor,repeal
name type data type description Authorization required string Use the JWT from the OAuth login from KeyClaok x-api-key required string Provide the api key given to you by the data register team
The post body will contain all the infomr
http code content-type 200application/json
curl -X PUT "https://dev-data.bcparks.ca/api/parks/0001/name?status=established" -H "authorization: None" -H "accept: application/json" -H "x-api-key: <YOUR_API_KEY>"
GET /api/search (Search the data register)
name type data type description text required string Provide text to search across the entire database type optional string protectedAreais the only option at this timestatus optional string Comma separated list of statuses: established,pending,repealed
name type data type description Authorization required string Use the string Nonex-api-key required string Provide the api key given to you by the data register team
http code content-type 200application/json
Show example response
{ "code": 200, "data": { "total": { "value": 2, "relation": "eq" }, "max_score": 6.8208785, "hits": [ { "_index": "main-index", "_id": "8#Details", "_score": 6.8208785, "_source": { "updateDate": "2023-12-08T00:23:47.720Z", "notes": "", "phoneticName": "", "searchTerms": "", "displayName": "Golden Ears Park", "lastModifiedBy": "noreply@gov.bc.ca", "audioClip": "", "type": "protectedArea", "legalName": "Golden Ears Park", "sk": "Details", "pk": "8", "displayId": "0008", "effectiveDate": "2023-12-03", "createDate": "2023-09-15T17:13:14.633Z", "status": "repealed" } }, { "_index": "main-index", "_id": "1080#Details", "_score": 5.516701, "_source": { "updateDate": "2023-12-11T19:46:03.536Z", "phoneticName": "", "searchTerms": "test", "displayName": "Golden Gate/Xáat Yádi Aani Conservancy abc", "lastModifiedBy": "noreply@gov.bc.ca", "audioClip": "", "type": "protectedArea", "legalName": "Golden Gate/Xáat Yádi Aani Conservancy", "sk": "Details", "pk": "1080", "displayId": "1080", "effectiveDate": "2012-05-31", "createDate": "2023-09-15T17:13:14.633Z", "status": "established" } } ] }, "msg": "Success", "error": null }
curl "https://dev-data.bcparks.ca/api/search?text=Golden" -H "authorization: None" -H "accept: application/json" -H "x-api-key: <YOUR_API_KEY>"