I am using Confluence data center to generate users invitation link using bash script
ENDPOINT= rest/invitation/1.0/invitation-link
USERNAME="admin"
API_TOKEN="XXXX"
# Make POST request to create a new invitation link
INVITE_RESPONSE=$(curl -s -u "${USERNAME}:${API_TOKEN}" -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \y
-d '{"expirationDate": "2025-02-26T00:00:00.000Z"}' \
"${CONFLUENCE_URL}/${ENDPOINT")
But getting authentication error
<!doctype html><html lang=en><head><title>HTTP Status 401 – Unauthorized</title><style type=text/css>body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class=line /><p><b>Type</b> Status Report</p><p><b>Message</b> Basic Authentication Failure - Reason : AUTHENTICATION_DENIED</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class=line /><h3>Apache Tomcat/9.0.54</h3></body></html>