Dropbox notification not invoke Lambda

0

I'm using lambda to excute an ingestion process from dropbox base on events. Dropbox allow to generate a webhook and I used the lambda url to send the messages. I enable the webhook URI in the Dropbox console, AWS ClodWatch logs confirms that my lambda function received, listened and executed the function. But when I add a file to my Dropbox folder, the AWS CloudWatch logs don't register any attempt to listen to the webhook from Dropbox. So i'm trying to figure out why my aws lambda function doesn't listen to webhooks. I used Cloud Functions from GCP and it works, why Lambda could not be invoke after I connected it?

asked 10 months ago244 views
2 Answers
0

You wrote that you got the initial invocation but not the actual notifications. I assume the issue is that you did not answer correctly to the first request, which is used to validate the endpoint. If you can post your code here, it can be helpful.

I saw that someone asked a similar question a few years ago: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Webhook-doesn-t-notify/td-p/387123. Maybe it can help.

profile pictureAWS
EXPERT
Uri
answered 10 months ago
  • I send back to dropbox the expected Response according to the documentation. In the dropbox app seems Enabled like if it received the right Response. but only works for the initial validation. Then I modified some files to trigger the webhook but Lambda not receive the notifications. I looked in CloudWatch but nothing appear. I tested in CloudFunction and it receive the notifications. This is my code:

    import json
    import boto3
    
    s3 = boto3.client('s3')
    
    def lambda_handler(event, context):
        bucket = 'evdaas-datalake'
        filename = "test.json"
        uploadByteStream = bytes(json.dumps(event).encode('UTF-8'))
        
        s3.put_object(Bucket=bucket, Key=filename, Body= uploadByteStream)
    
        
        if (event['requestContext']['http']['method'] == 'GET'):
            return {
                'headers': {
                    'Content-Type':'text/plain',
                    'X-Content-Type-Options':'nosniff'
                },
                'statusCode': 200,
                'body': f"{event['queryStringParameters']['challenge']}"        
            }
    
  • Your code looks correct. When happens if you try to invoke the same WebHook with POST from Postman or CURL? If it works, I think you should look at the Dropbox side.

0

Are you using lambda function URLs? Also do you have log statements within the lambda code to assess if logic get executed?

profile picture
EXPERT
answered 10 months ago
  • Yes, I'm using Lambda function URL, and it only works for the initial validation. Then, I modified some file to trigger the notifications, but it didn't work. I have similar code in CloudFunctions and it received the notifications. I reviewed in CloudWatch but there is nothing.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions