jordanfoki.blogg.se

Wordpresscom bitly integrations
Wordpresscom bitly integrations




  1. #Wordpresscom bitly integrations how to
  2. #Wordpresscom bitly integrations install
  3. #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.

wordpresscom bitly integrations

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.

  • Authentication Protocol: Password AuthenticationĬreate a custom URL field on your objects of interest to store the Bitly generated short urls.
  • Create a new Named Credential to securely store your Bitly group id and access token. In Salesforce, go to Setup and enter “Named Credential” in the quick find box, then click Named Credentials. If you have a paid account, you might consider creating a test group as described here. The group id is displayed in the URL when logged in to Bitly: /bitlinks/ You generated an access token in the prior step. When using the Bitly API, instead of authenticating with your username and password you’ll instead use a Bitly group id and an access token. A pop-up will appear with your new access token, copy it and store it someplace secure. You’ll be prompted for your Bitly password, enter it then click Generate Token. Note: For sites, you must have a Business plan or higher to use the.

    #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.

    wordpresscom bitly integrations

    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.






    Wordpresscom bitly integrations