Skip to content

Webhook.generate_test_header()

Methodtryyoursize

A valid TYS-Signature value, for your own tests.

@staticmethod
def generate_test_header(payload: Union[bytes, str], secret: str, timestamp: Optional[int] = None) -> str
payloadUnion[bytes, str]Required

The body you will send.

secretstrRequired

The signing secret.

timestampOptional[int]Optional= None

Unix seconds (default now).

str: A valid TYS-Signature value.

payload = json.dumps({"id": "evt_test", "object": "event", "type": "webhook.test", "data": {}})
header = tryyoursize.Webhook.generate_test_header(payload, "whsec_test")

Was this page helpful?