#gourav-kumar_files
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/1250338774110568510
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
So you have completed this step" https://docs.stripe.com/identity/access-verification-results#ip-allowlist ?
Yes
Check this files
I have defined the permission and Ip of my server where I have host my code
Ok, did you set the IP restriction before or after the request?
OK, this request was made last month at 2024-05-23 12:57:41 UTC, can you try it again?
Did you complete the "Edit the key and add the Access all sensitive verification results permission." step? https://docs.stripe.com/identity/access-verification-results#ip-allowlist
Yes
Can you check my shared screenshot I have shared in start of the chat
Please check define permission
But you didn't enable "Access all detailed verification results"
Can you enable this and try again?
Now I am getting this error
request ID?
req_2U3egSj95toGyn
Looks like the file already expired at 2024-05-18 12:44:02
ok
Can you tell mw how much time its available to generate links
and how we can get recent verified profile images or documents
https://docs.stripe.com/api/files/object#file_object-expires_at this property tells you when the file will expire.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Do we need restriction key to retrieve the recent file images
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
You should be able to retrieve it with your usual secret key. Is it not working for you?
req_rCDq80U7wsb57y
Can you check this is a recent test identity verification Its generated just now
But its not retrieve the documents from the normal key
And when we are using the restricted key then its given me this error
How we can manage the time for the document or we have to try on live server
We didn't check the test documents
Right, sorry for confusion. You will need to generate a restricted key specifically for this.
I have created a restricted key but its given me error
"error": "FileLinks for sensitive verification results must expire within 30 seconds. Learn more here: https://stripe.com/docs/identity/access-verification-results#images."
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_iEsqI8iT7Po9tp
The way file links should work is, the user requests a link via your app, and your app should generate a new link and redirect the user to it immediately. You shouldn't send file links via email etc., since they must be used fresh, i.e. within 30s.
If you want to send it via email, send a link to your own app, that, when accessed, will generate a freash Stripe file link.
currently I am not sending link to user ...I am trying to view it in json and and download the file using the link
We want to give me a report of verification with uploaded documents ..so we need documents fetch at our end to generate report
Can you create an endpoint that generates the file links and redirects the user to it immediately? Please try this and let me know if it is working as expected.
What do you mean?
I didn't received the json response for the file url
how can I redirect user to view the file
{
"id": "file_1Mr4LDLkdIwHu7ixFCz0dZiH",
"object": "file",
"created": 1680116847,
"expires_at": 1703444847,
"filename": "file.png",
"links": {
"object": "list",
"data": [],
"has_more": false,
"url": "/v1/file_links?file=file_1Mr4LDLkdIwHu7ixFCz0dZiH"
},
"purpose": "dispute_evidence",
"size": 8429,
"title": null,
"type": "png",
"url": "https://files.stripe.com/v1/files/file_1Mr4LDLkdIwHu7ixFCz0dZiH/contents"
}
I want to retrieve this type of response and I already create a function to retrieve this but I am not getting these type of response
I am getting error
Status
400 ERR
ID
req_iEsqI8iT7Po9tp
Yes, because you provide an invalid expires_at. What happens if you drop this parameter?
Where I have missed it can you tell me
try
{
$report = $stripe->identity->verificationReports->retrieve($verificationId, []);
$fileIds = $report->document->files ?? [];
$files = [];
foreach ($fileIds as $fileId)
{
$file = $stripe->files->retrieve($fileId, []);
$fileLink = $stripe->fileLinks->create([
'file' => $fileId,
'expires_at' => time() + 30000,
]);
if (!$fileLink->url) {
throw new \Exception('Failed to generate file link URL');
}
$files[] = [
'id' => $file->id,
'filename' => $file->filename,
'url' => $fileLink->url,
'purpose' => $file->purpose,
'created' => $file->created,
'expires_at' => $fileLink->expires_at,
];
}
return response()->json([
'report' => $report,
'files' => $files
]);
}
I am passing this param in api
gourav-kumar_files
๐ taking over for my colleague. Let me catch up.
I think this line should be
'expires_at' => time() + 30,
time() return time in seconds not in milliseconds
that explains why your request is failing
then what I need to pss
+30 not +30000
ok
sorry
Can you tell me can I extend time for the expires_at
because we want to generate report and download this image using the url
you can't do that unfortunately
this is sensitive data and should be expired after 30 seconds max
ok can we download it in our server if we add logic here with params
or there is any way to show the reports of verification to our user from stripe verification
you can use https://docs.stripe.com/identity/verification-sessions#results to show the results to your user
But in this documentation not mention how to user view there uploaded documents
they can't
they shouldn't
once you upload the file to our servers you should not download them to any surface not even to your own servers