From one month API script not running

Hi,

Below is the curl command for changing the frequency apart from the given in UI. This script was running fine before one month. Suddenly it is giving. Please let me know if the mention details are changed?

Below is the error text:
curl -v -X PATCH -H ‘X-Api-Key:[redacted by New Relic]’ -H ‘Content-Type:application/json’ https://synthetics.newrelic.com/synthetics/api/v3/monitors/817849f9-362d-42b5-98ea-aef81d787542 -d ‘{“frequency”:15}’

  • Trying 54.173.54.237…
  • TCP_NODELAY set
  • Connected to synthetics.newrelic.com (54.173.54.237) port 443 (#0)
  • schannel: SSL/TLS connection with synthetics.newrelic.com port 443 (step 1/3)
  • schannel: checking server certificate revocation
  • schannel: sending initial handshake data: sending 188 bytes…
  • schannel: sent initial handshake data: sent 188 bytes
  • schannel: SSL/TLS connection with synthetics.newrelic.com port 443 (step 2/3)
  • schannel: failed to receive handshake, need more data
  • schannel: SSL/TLS connection with synthetics.newrelic.com port 443 (step 2/3)
  • schannel: encrypted data got 3154
  • schannel: encrypted data buffer: offset 3154 length 4096
  • schannel: sending next handshake data: sending 126 bytes…
  • schannel: SSL/TLS connection with synthetics.newrelic.com port 443 (step 2/3)
  • schannel: encrypted data got 274
  • schannel: encrypted data buffer: offset 274 length 4096
  • schannel: SSL/TLS handshake complete
  • schannel: SSL/TLS connection with synthetics.newrelic.com port 443 (step 3/3)
  • schannel: stored credential handle in session cache

PATCH /synthetics/api/v3/monitors/817849f9-362d-42b5-98ea-aef81d787542 HTTP/1.1
Host: synthetics.newrelic.com
User-Agent: curl/7.55.1
Accept: /
[redacted by New Relic]
‘Content-Type:application/json’
Content-Length: 16
Content-Type: application/x-www-form-urlencoded

@ssirsikar Sorry you have been waiting awhile for a response from our community. I’m going to bring this back to the attention of our support team. Thanks for your patience!

Neal Mc

Expecting early response at least now.

Hi Neal,

Can i get some response on this.

Hi @ssirsikar,

This has been a complicated case, but I’d like to present you with my findings.

I do want to mention that for security reasons, we have redacted the API key that was present in this ticket. That said, our records show that this API key — which was an account’s REST API key — was disabled in November 2017.

I would not have expected this CURL to have successfully executed since then; it may simply be that the error message has changed. To complicate things further, in order to hit our Synthetics API, you will need to use an Admin API key or a User API key; a REST API key should not be compatible, valid or not. Therefore, I would not have expected it to work in 2017 either.

I’d like to refer you to our documentation on API key types for further reading. Please let me know if an Admin or User key gives you any trouble, as these are the key types that should work against the Synthetics API endpoints.

I’ll be watching this thread should you need further assistance.

Jeffrey

2 Likes

Thanks Jeffrey for long awaited reply. I have tired to run using Admin and User both key. But it is still showing same error. Can you try to run this script using my account Admin key and let me know if get success in same.

Thanks,
Sonali

Hi @ssirsikar, our security policies also prevent me from seeing your API keys, so I would not be able to run a test on your account. That said, I ran a test on my own personal account, and the following call worked for me:

curl -v -X PATCH -H 'X-Api-Key: ADMIN_KEY' \
-H 'Content-Type:application/json' \
https://synthetics.newrelic.com/synthetics/api/v3/monitors/MONITOR_ID \
-d '{"frequency":15}'

I would like to see if this exact call works for you as well (once you’ve substituted the proper API key and monitor ID variables).

If it still doesn’t work, I would like to see the full call and response again, along with a partially obfuscated API key (ideally the first few characters following the NRAA- or NRAK- prefix).

A caveat I’d like to note: If you’re using an Admin API key then you’ll need to use the header X-Api-Key, but if you’re using a User API key your header will need to be just Api-Key.