Skip to content

How to change your API endpoint?

Antoine Augusti edited this page Nov 30, 2020 · 13 revisions

When setting up your Notify api client for the Canadian endpoint you need to pass a base url parameter before your api key.

Examples:

Node JS

NotifyClient("https://api.notification.canada.ca", apiKey)

https://github.com/alphagov/notifications-node-client

Java

public NotificationClient(final String apiKey, final String baseUrl) {

https://github.com/alphagov/notifications-java-client

.Net

public NotificationClient(string baseUrl, string apiKey) 

https://github.com/alphagov/notifications-net-client

Python

See config options: https://github.com/alphagov/notifications-python-client/blob/master/notifications_python_client/base.py#L22

PHP

require __DIR__ . '/vendor/autoload.php';

$notifyClient = new \Alphagov\Notifications\Client([
  'baseUrl' => "https://api.notification.canada.ca",
  'apiKey' => 'your-api-key',
        'httpClient' => new \Http\Adapter\Guzzle6\Client
]);

See config options: https://github.com/alphagov/notifications-php-client/blob/master/src/Client.php#L84