Invalid API key

newbie trying for first time to utilize an open cloud API.

I’ve created (today, 2022/12/20 8:52am CST) a new API Key and its status is Active and Enabled.
In trying to imitate the tutorial example to list datastores (using curl) for my own game.

(tutorial i imitated: https://create.roblox.com/docs/open-cloud/data-store-api )

an authentication error is returned: 401
full body of response:

HTTP/2 401
date: Tue, 20 Dec 2022 15:36:09 GMT
server: Kestrel
strict-transport-security: max-age=3600
report-to: {"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}
nel: {"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}

Invalid API Key.%

There are likely some common newbie mistakes.
What are some?

script:

#!/bin/ksh
export API_KEY=<redacted>

curl \
--include \
--location \
--request GET \
"https://apis.roblox.com/datastores/v1/universes/3987110625/standard-datastores" \
--header "x-api-key: ${API_KEY}" \
--get

Here is verbose mode:

Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying 128.116.101.4:443...
* Connected to apis.roblox.com (128.116.101.4) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.roblox.com
*  start date: Jul 18 21:54:17 2022 GMT
*  expire date: Aug 13 22:53:34 2023 GMT
*  subjectAltName: host "apis.roblox.com" matched cert's "*.roblox.com"
*  issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x146011400)
> GET /datastores/v1/universes/3987110625/standard-datastores HTTP/2
> Host: apis.roblox.com
> user-agent: curl/7.79.1
> accept: */*
> x-api-key: <redacted>
>
< HTTP/2 401
HTTP/2 401
< date: Tue, 20 Dec 2022 15:56:19 GMT
date: Tue, 20 Dec 2022 15:56:19 GMT
< server: Kestrel
server: Kestrel
< strict-transport-security: max-age=3600
strict-transport-security: max-age=3600
< report-to: {"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}
report-to: {"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}
< nel: {"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}
nel: {"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}

<
* Connection #0 to host apis.roblox.com left intact
Invalid API Key.%
1 Like

Make sure your API key is valid, Make sure you whitelisted its external IP.

did u try turning it on and off again and clearing ur cookies

thanks for the suggestions - i’ll be trying this again soon.