In the JCP log you find the following error:
20210526/155108.345 - 58 U00045098 Method 'GET', URL: 'http://server.domain.example.com:8088/ae/api/v1/22/objects/MY_OBJECT', received from IP: '<IP address>'
20210526/155108.361 - 58 U00045099 The server replied with following status: '401'
When activating the JCP trace (Rest=9), you find the following error:
20210526/155108.345 - 58 U00045098 Method 'GET', URL: 'http://server.domain.example.com:8088/ae/api/v1/22/objects/MY_OBJECT', received from IP: '<IP address>'
20210526/155108.361 - 58 Request-Headers: [Host=server.domain.example.com:8088,User-Agent=Jakarta Commons-HttpClient/3.1]
20210526/155108.361 - 58 Request-Payload:
20210526/155108.361 - 58
20210526/155108.361 - 58 Authentication Failed: Authorization header is missing
20210526/155108.361 - 58 U00045099 The server replied with following status: '401'
20210526/155108.361 - 58 Response-Headers: [Content-Type=application/json,WWW-Authenticate=Basic realm="AUTOMIC"]
20210526/155108.361 - 58 Response-Payload:
20210526/155108.361 - 58 {
20210526/155108.361 - 58 "code" : 45229,
20210526/155108.361 - 58 "error" : "Authorization header is missing.",
20210526/155108.361 - 58 "details" : "No detail information available."
20210526/155108.361 - 58 }
When looking further in the trace you will see that the exact same request is received a second time, this time with the header included:
20210526/155108.439 - 49 U00045098 Method 'GET', URL: 'http://server.domain.example.com:8088/ae/api/v1/22/objects/MY_OBJECT', received from IP: '<IP address>'
20210526/155108.439 - 49 Request-Headers: [Authorization=Basic TVZFL01WRTpNVkU=,Host=server.domain.example.com:8088,User-Agent=Jakarta Commons-HttpClient/3.1]
20210526/155108.439 - 49 Request-Payload:
20210526/155108.439 - 49
20210526/155109.283 - 49 U00045105 Log on of 'USERNAME' successful.
Automic Automation v12.2 / v12.3
JCP REST Endpoint
This expected behavior, see here: https://en.wikipedia.
What happens is that by default the initial request is sent without header. The protocol then sends a 401 error back, upon which requester includes the header and sends the request again.
In some case the error message can be prevented by preemptively sending the header.
For instance in the case of the Automic REST Agent, you can tick the option 'Preemptive' in the REST Connection Object: