I follow the document above, and successfully get the JWT from POST /api/v2/signeddata. However, where should I send this JWT token? and how to verify this token at PureCloud side?
You send the JWT token when you start the chat, as far as I understand the token is verified by PureCloud when they receive it (after all they were the one who created it).
If you look at the flow here, the following steps occur:
The customer signs into your website (Third Party Org Site), this way you know the customer is who they say they are because they logged into your site.
You then use the authentication they have with your website to make a request to your backend service to get a JWT signed by PureCloud.
Your backend uses the authentication to retrieve customer specific information from your system.
Your backend then uses this information to make a new request to PureCloud (with the customer information) which returns a JWT signed by them (containing the information you just gave them).
Your backend should then send a response back to your frontend with the JWT from PureCloud.
The frontend then sends the JWT when starting a new chat with PureCloud. How you send the JWT/token depends on if you are using the API directly or the widget provided by PureCloud. If you are using the API it should be sent via the memberAuthToken property when starting the chat. If you are using the widget it should be added here. Look at the example and you'll see headers containing a Client-Token property, that's where you send the JWT/token received from your backend service.
PureCloud then validates the signature and starts a new chat in their system.
Keep in mind that if you send the custom fields both via authenticated method and via unauthenticated method, both will be available on the conversation. Not sure if that's your intent. You should only send the custom fields via the jwt token to get only the signed ones.