Recent searches


No recent searches

Zendesk JWT how to send custom data?

Answered


Posted Feb 01, 2021

Hello!
We have a closed common info on Help Center for our customers. We use Zendesk SSO JWT for authorization from https://support.zendesk.com/hc/en-us/articles/203663816#topic_w5x_1fh_3fb link and it works correctly, but in code, we have to provide a static name/email for payload. Like in example code. We'd like to allow every customer to log in with their own name/email. Customers open https://sub-domain.zendesk.com/ and I'd like to send some custom data (ex. customer_id) to catch which one sends a request on our side. How can I do it

Thank you! 

payload = {
"iat": int(time.time()),
"jti": str(uuid.uuid1()),
"name": "Test Test",
"email": "test@test.com"
}

shared_key = settings.ZENDESK_SHARED_KEY
jwt_string = jwt.encode(payload, shared_key)

0

1

1 comment

Grigory Fateyev

You can use the "user_fields" (key/values) ... as documented here:

https://support.zendesk.com/hc/en-us/articles/4408845838874

payload = {
'iat': int(time.time()),
'jti': str(uuid.uuid1()),
'name': '...',
'email': '...',
'user_fields': { 'ext_info': 'AAAGGG99Z04J599Z', 'ext_info2': ''blah blah blah... }
}

0


Post is closed for comments.

Didn't find what you're looking for?

New post