Debugging the Salesforce Pub/Sub API using Postman (Part 2)
This article explains how to fully debug and interact with the Salesforce Pub/Sub API using Postman's new gRPC scripting capabilities, especially for handling Avro formatted messages. It walks through setting up Postman for Pub/Sub API requests, managing authentication, retrieving topics and schemas, subscribing to platform events, decoding Avro payloads, and publishing events with Avro encoding entirely within Postman. Salesforce teams can leverage these detailed scripts and steps to build efficient, reusable testing and debugging workflows for event-driven integrations without relying on external tools. This approach helps simplify publish-subscribe interactions for platform events using Postman alone.
- Use Postman 11.45.3+ to publish and subscribe to Salesforce Platform Event messages via gRPC.
- Setup environment variables in Postman for flexible authentication and dynamic payload handling.
- Decode Base64 Avro-encoded payloads using Postman on-message scripts for readable event data.
- Publish Platform Events with fully Avro encoded payloads via Postman before-invoke scripts.
- Maintain subscriptions in Postman to receive and validate live platform event messages.
Postman now supports “on message scripts” in gRPC requests so we can publish Avro formatted messages directly from Postman! In Debugging the Salesforce Pub/Sub API using Postman (Part 1) We ran you through the setup of the Pub/Sub API in postman. We discussed the issue that because the lack of Apache Avro support we cannot publish messages directly from Postman. Release 11.45.3 fixes this gap. I created a custom testing tool that made it super easy to connect to your org, auto-generate payloads and publish the events directly from the tool. Alternatively you could copy the payloads to postman, but this was a bit of overhead. The tool is now sort of obsolete but it’s still a nice tool for quick tests without having to setup Postman. I would recommend reading Part 01 before you continue for some more if you want some more background information although you should be able to follow the setup just fine without having read part 01.