#max_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1253662411962056717
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
I went to the logs and it doesn't show up! here is a picture of the error i'm getting though
i got this restricted key not from the dashboard, but from going through the oauth2 flow and then using the refresh token endpoint
You mean once the API key generated from this step:
https://docs.stripe.com/connect/oauth-reference#post-token
The resulting key is directly expired ?
I was following this guide:
https://docs.stripe.com/stripe-apps/api-authentication/oauth#refresh-access-token
i'm not using connect, i'm following the oauth instructions for my stripe app
req_aN1j5TaQigH5vp is an example of a request i made to get the access token
the stripe_user_id = acct_1PTWLvBWS2u8NcV5 matches the account i authenticated with
but yes, the resulting key is immediately expired
Taking over here. Can you share paste the rk_xxx key you're using?
rk_test_51PTWLvBWS2u8NcV5hfAZO6GKnwt1yL2cHdT3qZDthAIhUziE8LVMbX6TAutTWnZCQdYak6p0MeQlnFwJtLGt1ZFx00DPCdLchY
just refreshed it again:
rk_test_51PTWLvBWS2u8NcV5hfAZO6GKnwt1yL2cHdT3qZDthAIhUziE8LVMbX6TAutTWnZCQdYak6p0MeQlnFwJtLGt1ZFx00DPCdLchY
@sour wind any idea what's wrong with the key?
Can you share an API request that you're making with the key that errors?
curl -G https://api.stripe.com/v1/disputes \
-u "rk_test_51PTWLvBWS2u8NcV5hfAZO6GKnwt1yL2cHdT3qZDthAIhUziE8LVMbX6TAutTWnZCQdYak6p0MeQlnFwJtLGt1ZFx00DPCdLchY:" \
-d limit=3
{
"error": {
"code": "platform_api_key_expired",
"doc_url": "https://stripe.com/docs/error-codes/platform-api-key-expired",
"message": "Expired API Key provided: rk_test_*********************************************************************************************CdLchY. Platform access may have been revoked.",
"type": "invalid_request_error"
}
}
I also tried:
curl -G https://api.stripe.com/v1/disputes \
-u "rk_test_51PTWLvBWS2u8NcV5hfAZO6GKnwt1yL2cHdT3qZDthAIhUziE8LVMbX6TAutTWnZCQdYak6p0MeQlnFwJtLGt1ZFx00DPCdLchY:" \
-d limit=3 -H "Stripe-Livemode: false" -H "Stripe-Account: acct_1PTWLvBWS2u8NcV5"
{
"error": {
"code": "platform_api_key_expired",
"doc_url": "https://stripe.com/docs/error-codes/platform-api-key-expired",
"message": "Expired API Key provided: rk_test_*********************************************************************************************CdLchY. Platform access may have been revoked.",
"type": "invalid_request_error"
}
}
(including some more stripe headers)
i cant share the req_ id because it's not showing up in any logs
is it over for me
Please be patient, I'm checking on this. It's pretty busy
thanks for ur help
Wait, I think you're using the wrong key in your API requests. You should be passing access_token not refresh_token
The refresh token is simply for generating a new access token
i am passing the access token
refresh token = rt_QKkms2PrExb29J5s4cDTDrgRoGGx75XXJoTQKDKgT7jigBzM
acct_1PTWLvBWS2u8NcV5 isn't even connected to a platform/app publisher. Likely explains the 'access revoked' error?
Seems it was disconncted here: https://dashboard.stripe.com/test/events/evt_1PTf8uBWS2u8NcV5dmt2VXPx
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
honestly that's a strange bug, because in the dashboard the app was clearly installed. but i uninstalled/reinstalled (here's the event)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
now i'm still getting this
curl -G https://api.stripe.com/v1/disputes \
-u "rk_test_51PTWLvBWS2u8NcV5hfAZO6GKnwt1yL2cHdT3qZDthAIhUziE8LVMbX6TAutTWnZCQdYak6p0MeQlnFwJtLGt1ZFx00DPCdLchY:" \
-d limit=3 -H "Stripe-Livemode: false" -H "Stripe-Account: acct_1PTWLvBWS2u8NcV5"
{
"error": {
"message": "Invalid API Key provided: rk_test_*********************************************************************************************CdLchY",
"type": "invalid_request_error"
}
}
but curiously enough two of the error fields disappeared, now it's just saying "Invalid API key provided"
ah
actually i think that was a mistake on my part
i refreshed again and it works now
thanks so much for ur help