How to base64 encrypt rest message payload
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 09:54 AM
Hi, i have created a rest post method and invoking it through business rule . I need to encrypt the payload.. how to do it? Is it done in rest message or in business rule or somewhere else?
Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 10:13 AM
Hi @Swapnil Shirsik ,
You can encrypt the payload in your business rule, use this following line of code:
var encryptedPayload = GlideStringUtil.base64Encode(json_payload);
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 10:53 AM
Thanks for reply .
The json_payload you are referring to- is like body?
Var body={
...
}
And i need to use this one line script at the bottom after the body is defined or after r.execute?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 10:57 AM
@Swapnil Shirsik - you can use this line just after the body is defined.
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2023 04:26 AM
Thanks for reply.. i tried but no response.. I have entered your script after body and then set the body as
r.setRequestBody('encryptedPayload');
Please could you confirm if I'm sending the encrypted payload in correct way?