
- #Wordpresscom bitly integrations how to
- #Wordpresscom bitly integrations install
- #Wordpresscom bitly integrations code
When the async process completes then it updates the Case objects with the new short urls. This is required because if you don’t then you’ll get an error that you have uncommitted work and you must either commit or rollback before making the http callout to the Bitly service.

An important point to note is that the BitlyShortenURLInvocable class actually calls a method to generate the short urls asynchronously. I developed two classes, one that encapsulates the Bitly http callouts and the other to expose the service as so it can be invoked by Process Builder or Flow Builder.
#Wordpresscom bitly integrations code
The sample code I share only supports one on the Case object, but you can easily adapt the code to your needs. Depending on your situation you may have one or more.
#Wordpresscom bitly integrations install
Go to to generate an access token you can use with the Bitly API. WordPress Integration Details Install the CoSchedule WordPress Plugin. I chose to create a Bitly specific login because I don’t like sharing my social logins with websites. You can sign-up using Twitter, Facebook, or create a new login with their service. To use the Bitly API you will need to register.

When the “Short URL” field becomes non-blank then Process Builder sends an email alert to the case owner with the shortened link. If the field is blank then it calls out to Bitly to generate the url asynchronously (the async part is important and I’ll discuss that later). I have a single Process that kicks off when a Case is created or updated and monitors when the “Short URL” field changes. In my example below, I added a custom field “Short URL” to the Case object. This was a fun challenge and I ended up using apex class so that the URL shortening could be kicked off by Process Builder.
#Wordpresscom bitly integrations how to
This post is inspired by Jared Baker who asked about how to integrate Salesforce and Bitly to create short urls to include in email alerts. This post was updated on Januto use Bitly’s API v4, which changed how to authenticate to their API.
