The intent here is to enable per-endpoint API versioning so service APIs can be introduced incrementally (e.g., pending services with API version /21/).
No endpoints were introduced with new versions. This PR just places the version for APIs in endpoint calls.
These changes are being made such that the COG_URL_PREFIX environment variable no longer requires the API version in the string. For example, where the API base URL and version were previously set (e.g., export COG_URL_PREFIX=https://api.cogniac.io/1/), now only the base API URL would need to be set (e.g., export COG_URL_PREFIX=https://api.cogniac.io/). The SDK will detect if the version is specified and strip it from the COG_URL_PREFIX if present.
If COG_URL_PREFIX includes the version, it will be stripped.
Summary of changes
[x] Added endpoint version for following occurrences:
[x] requests.get, requests.post, requests.delete
[x] _get(
[x] _post(
[x] _delete(
[x] "url ="
[x] test SDK with COG_URL_PREFIX=https://api.cogniac.io/1 (backward compatibility)
[x] test SDK with COG_URL_PREFIX=https://api.cogniac.io/1/ (backward compatibility)
[x] test SDK with COG_URL_PREFIX=https://api.cogniac.io
[x] test SDK with COG_URL_PREFIX=https://api.cogniac.io/
The intent here is to enable per-endpoint API versioning so service APIs can be introduced incrementally (e.g., pending services with API version
/21/
).No endpoints were introduced with new versions. This PR just places the version for APIs in endpoint calls.
These changes are being made such that the
COG_URL_PREFIX
environment variable no longer requires the API version in the string. For example, where the API base URL and version were previously set (e.g.,export COG_URL_PREFIX=https://api.cogniac.io/1/
), now only the base API URL would need to be set (e.g.,export COG_URL_PREFIX=https://api.cogniac.io/
). The SDK will detect if the version is specified and strip it from theCOG_URL_PREFIX
if present.If
COG_URL_PREFIX
includes the version, it will be stripped.Summary of changes
requests.get
,requests.post
,requests.delete
_get(
_post(
_delete(
"url ="
COG_URL_PREFIX=https://api.cogniac.io/1
(backward compatibility)COG_URL_PREFIX=https://api.cogniac.io/1/
(backward compatibility)COG_URL_PREFIX=https://api.cogniac.io
COG_URL_PREFIX=https://api.cogniac.io/