How to make a REST callout/integration from Salesforce to Github REST API

Usually to integrate with an external system that supports REST API, you need to make REST callouts from Salesforce. This blog demonstrates how to make a REST callout from Salesforce to Github.

Demo



Code Sample


Steps

  • Add remote site settings
  • Create GithubApi class with a method to make API call
  • Copy code from code snippets and save class
  • Execute the class in developer console using System.debug(GithubApi.getGithubUserDetails('SalesforceCodes'));

2 comments:

  1. Authentication & authentication is the integral part of Integration. Can you cover the JWT token flow for server to server integration?

    ReplyDelete
    Replies
    1. Sure Srinivasan. Will make a video and update here.

      Delete