Here is a code sample to help you with your Basic Authentication method implementation. This example is run on the ****Test endpoint.

Bash

#! /bin/bash

# Put your public key here, keep it on a single line
PUB_KEY="-----BEGIN RSA PUBLIC KEY-----MEgCQQCQyhMk37PWcf8Y/5jbjPxhMw/N35PwCasZUdWvhLWIHf6YqOuyo00Jtc7M0kj3/tybiWAZ1X3NSIvmTXJ5J2ctAgMBAAE=-----END RSA PUBLIC KEY-----"

# Example body
BODY='{"testArray":["this","is","an","array"],"testBool":true,"testNumber":123,"testObject":{"a":true,"b":false},"testString":"hello"}'

# Example query params
QUERY_PARAMS='{"bar":"42","foo":"hi"}'

# Make the request
curl \\
 -X POST \\
 -d $BODY \\
 '<https://api.resolve.ch/api/test?foo=hi&bar=42>' \\
 -H 'Content-Type: application/json' \\
 -H "X-RESOLVE-Authorization: RESOLVE-BASIC ${PUB_KEY}" \\