DEVELOP GUIDES
Working with Events and presignedUrl
4min
Events and presignedUrl requires partners to provide webhook for Klavi event reception, and proactively obtain analysis result files based on the presignedUrl in the event.
Partners need to configure the following information in the Console:
- Events receiving method(Push/Pull)
- Webhook for event reception(If push events method)
- Encryption Options(Yes/No)
The above information can also be provided to Klavi business personnel for Klavi to fill in.
After Klavi completes the data analysis, it will send notifications to the configured webhooks.
JSON
1{
2 "partnerAppId":"12345678",
3 "eventId":"1495468585434-0e73d1719173766fe4dfe1a8",
4 "eventType":"analysis",
5 "eventName":"analysis_finished",
6 "eventTime":"2025-02-26T20:08:17.848Z",
7 "payload":{
8 "batchId":"25872252137",
9 "presignedUrl":"https://amzn-s3-demo-bucket.s3.us-west-2.amazonaws.com/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE123456789%2F20210621%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210621T041609Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=EXAMBLE1234494d5fba3fed607f98018e1dfc62e2529ae96d844123456"
10 }
11}
Parse the above event and obtain the presignedUrl of the sharing file.
HTML
1https://amzn-s3-demo-bucket.s3.us-west-2.amazonaws.com/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE123456789%2F20210621%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210621T041609Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=EXAMBLE1234494d5fba3fed607f98018e1dfc62e2529ae96d844123456
Bash
Python
1wget -O <output-file-name> https://amzn-s3-demo-bucket.s3.us-west-2.amazonaws.com/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE123456789%2F20210621%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210621T041609Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=EXAMBLE1234494d5fba3fed607f98018e1dfc62e2529ae96d844123456
2# or
3curl -o <output-file-name> https://amzn-s3-demo-bucket.s3.us-west-2.amazonaws.com/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE123456789%2F20210621%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210621T041609Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=EXAMBLE1234494d5fba3fed607f98018e1dfc62e2529ae96d844123456
The default lifecycle of presignedUrl is 1 day (24 hours), starting from eventTime. Partners need to complete file retrieval before the end of the lifecycle, otherwise the URL will become invalid.
Updated 28 Feb 2025
Did this page help you?