Calling API with bearer token for authentication:
file_get_contents('https://ntfy.example.com/mysecrets', false, stream_context_create([ 'http' => [ 'method' => 'POST', // PUT also works 'header' => 'Content-Type: text/plain\r\n' . 'Authorization: Bearer tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2', 'content' => 'Look ma, with auth' ] ]));
Calling API with username and password:
username = "testuser" password = "fakepassword" authHeader = "Basic " + base64(username + ":" + password) // -> Basic dGVzdHVzZXI6ZmFrZXBhc3N3b3Jk
echo "Basic $(echo -n 'testuser:fakepassword' | base64)"
file_get_contents('https://ntfy.example.com/mysecrets', false, stream_context_create([ 'http' => [ 'method' => 'POST', // PUT also works 'header' => 'Content-Type: text/plain\r\n' . 'Authorization: Basic dGVzdHVzZXI6ZmFrZXBhc3N3b3Jk', 'content' => 'Look ma, with auth' ] ]));
API calls are working properly
No dependencies set.
The note is not visible to the blocked user.
Calling API with bearer token for authentication:
Calling API with username and password:
echo "Basic $(echo -n 'testuser:fakepassword' | base64)"API calls are working properly