Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Enable to add headers template in webhooks created dynamically#419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Pijukatel merged 1 commit intoapify:masterfromgaelloyoly:patch-1
Jun 16, 2025

Conversation

gaelloyoly
Copy link
Contributor

@gaelloyolygaelloyoly changed the titleBeing able to add headers template in webhooks created dynamicallyfeat: being able to add headers template in webhooks created dynamicallyJun 13, 2025
@gaelloyolygaelloyolyhad a problem deploying to fork-pr-integration-testsJune 13, 2025 11:28 — withGitHub Actions Failure
vdusek

This comment was marked as outdated.

@Pijukatel
Copy link
Contributor

Pijukatel commentedJun 13, 2025
edited
Loading

@gaelloyoly Hello, thank for the PR. Just to help me understand the context of the change. In what situation do you get "headers_template" key in that dictionary? In other workds, why is it not 'headersTemplate' directly?

@gaelloyoly
Copy link
ContributorAuthor

@Pijukatel I wanted to create an ad-hoc webhook and I followed the example by passing a dict with payloadTemplate and headerTemplate but none of them was used.
Then I saw that the Webhook data structure in python is using underscores :https://docs.apify.com/sdk/python/reference/class/Webhook
I guess it's to make it more "pythonic". That's why I'm using this for headers too.

@Pijukatel
Copy link
Contributor

Pijukatel commentedJun 13, 2025
edited
Loading

@gaelloyoly Could you please describe your top level call (Which client did you use, or did you call someActor method from Apify SDK?) Because I see, that there is a function that is already responsible for conversion from underscore names:https://github.com/apify/apify-client-python/blob/master/src/apify_client/clients/resource_clients/webhook.py#L24
, but most likely there is some path that is not using this function, so that is why I want to understand how you called it.

@gaelloyoly
Copy link
ContributorAuthor

gaelloyoly commentedJun 13, 2025
edited
Loading

Yes, it's the "start" method of the actor client. I'm doing something like this :

fromapify_clientimportApifyClientclient=ApifyClient("APIFY_API_KEY")client.actor("actor_id").start(run_input={"url":"input_url"},webhooks=[{"event_types": ["ACTOR.RUN.SUCCEEDED"],"request_url":"https://example.com/success","payload_template":"{{resource}}","headers_template":'{"x-custom-signature": "1234567890"}',    }],)

@Pijukatel
Copy link
Contributor

Yes, it's the "start" method of the actor client. I'm doing something like this :

fromapify_clientimportApifyClientclient=ApifyClient("APIFY_API_KEY")client.actor("actor_id").start(run_input={"url":"input_url"},webhooks=[{"event_types": ["ACTOR.RUN.SUCCEEDED"],"request_url":"https://example.com/success","payload_template":"{{resource}}","headers_template":'{"x-custom-signature": "1234567890"}',    }],)

Thank you for the PR and the clarification. I created issue to refactor the part of the code responsible for handling the Webhooks inputs and in the meantime let's merge your PR.

@PijukatelPijukatel merged commitb84d1ec intoapify:masterJun 16, 2025
26 of 28 checks passed
@PijukatelPijukatel changed the titlefeat: being able to add headers template in webhooks created dynamicallyfix: Enable to add headers template in webhooks created dynamicallyJun 16, 2025
@gaelloyoly
Copy link
ContributorAuthor

Thanks !

@gaelloyolygaelloyoly deleted the patch-1 branchJune 16, 2025 07:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@PijukatelPijukatelPijukatel approved these changes

@vdusekvdusekAwaiting requested review from vdusek

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@gaelloyoly@Pijukatel@vdusek

[8]ページ先頭

©2009-2025 Movatter.jp