#gourav-kumar_files

1 messages ยท Page 1 of 1 (latest)

scenic mossBOT
#

๐Ÿ‘‹ 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.

ocean depot
dawn heart
#

Yes

#

Check this files

#

I have defined the permission and Ip of my server where I have host my code

ocean depot
#

Ok, did you set the IP restriction before or after the request?

dawn heart
#

before the request

#

I have tried the request api after setting the permission and IP

ocean depot
#

OK, this request was made last month at 2024-05-23 12:57:41 UTC, can you try it again?

dawn heart
#

sure

#

ID
req_bTw8Ydj61iUdRV

ocean depot
dawn heart
#

Yes

#

Can you check my shared screenshot I have shared in start of the chat

#

Please check define permission

ocean depot
#

But you didn't enable "Access all detailed verification results"

#

Can you enable this and try again?

dawn heart
#

Now I am getting this error

ocean depot
#

request ID?

dawn heart
#

req_2U3egSj95toGyn

ocean depot
#

Looks like the file already expired at 2024-05-18 12:44:02

dawn heart
#

ok

#

Can you tell mw how much time its available to generate links

#

and how we can get recent verified profile images or documents

ocean depot
scenic mossBOT
dawn heart
#

Do we need restriction key to retrieve the recent file images

ashen field
#

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?

dawn heart
#

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

ashen field
#

Right, sorry for confusion. You will need to generate a restricted key specifically for this.

dawn heart
#

I have created a restricted key but its given me error

ashen field
dawn heart
#

req_iEsqI8iT7Po9tp

ashen field
#

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.

dawn heart
#

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

ashen field
#

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.

dawn heart
#

You mean I have to view it immediately to user

#

But I didn't get the link

ashen field
dawn heart
#

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

scenic mossBOT
ashen field
dawn heart
#

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

scenic mossBOT
#

gourav-kumar_files

shrewd mesa
#

๐Ÿ‘‹ 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

dawn heart
#

then what I need to pss

shrewd mesa
#

+30 not +30000

dawn heart
#

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

shrewd mesa
#

you can't do that unfortunately

#

this is sensitive data and should be expired after 30 seconds max

dawn heart
#

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

shrewd mesa
dawn heart
#

But in this documentation not mention how to user view there uploaded documents

shrewd mesa
#

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

solemn jackalBOT