Giter Club home page Giter Club logo

go-trailhead-leaderboard-api's Introduction

Trailhead Leaderboard API

A Golang app that makes callouts to trailblazer.me/ and retrieves Trailblazer User data which can then be used in other applications.

๐Ÿšจ Note: In order to retrieve data for a specific Trailhead User, they must have their profile set to public.

Trailhead changes their services occasionally so this can break at any time!

Installation

If you have Go installed, you can run it locally by using the run command on main.go.

$ go run main.go

Endpoints

This app has a few different endpoints for accessing public Trailhead data.

Profile Data

/trailblazer/matruff/profile

This endpoint returns public profile information found on trailblazer.me like "about me", company info, name, and profile/banner photos. Example

Badge Data

This endpoint returns badges earned by the Trailblazer. The basic call without any options only gives a max of 8 at a time, representing your most recently earned badges.

/trailblazer/matruff/badges

You can also filter badges by sending a string at the end of the URL without or without optional count. Possible filter values are: all, module, superbadge, event, and project. Example

/trailblazer/matruff/badges/superbadge

or

/trailblazer/matruff/badges/all/24

The GraphQl endpoint returns a pageInfo record in the response that you can use to query for additional pages past the first count you provide. For example, in your first response for a coutn of 16 you'll get the endCursor value to use in your next callout to get the page after it. Pass that at the end of the API endpoint and you'll get the next 16 results. The response also tells you if there is a next page.

pageInfo response example:

"pageInfo": {
    "__typename": "PageInfo",
    "endCursor": "eyJzIjoiMDI2NmQzOGEtZjc1MS0zOTEwLTQ0NGItOW[...]",
    "hasNextPage": true,
    "startCursor": "eyJzIjoiMDI5YWQzNjItYWQ0Mi0yOTY0LWNlMTMt[...]",
    "hasPreviousPage": false
}

Using endCursor as after:

/trailblazer/matruff/badges/all/16/24eyJzIjoiMDI2NmQzOGEtZjc1MS0aOTEwLItOWU4MzRx[...]

Certifications Data

/trailblazer/matruff/certifications

This endpoint returns Certifications the Trailblazer has achieved. Example

Special Thanks

Thanks to both @Patlatus and @krankekatze for the inspiration to build this. Check out their repos for related solutions.

go-trailhead-leaderboard-api's People

Contributors

homie980 avatar meruff avatar paulweakley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-trailhead-leaderboard-api's Issues

Support Certifications

Salesforce just released Certifications on your trailblazer.me profile. Please consider supporting it :)

Certifications endpoint broken

Can't retrieve certifications from trailhead currently. Need to investigate what Trailhead changed which broke the service.

Heroku shutting down free tier. Now what?

Description

In an absolutely ridiculous decision, Heroku is shutting down free dynos. I will need to move my Trailhead API off of Heroku before November. I will also be moving all my projects off of Heroku and shutting down my account permanently. I will need to figure out a new host or deprecate this repo in favor of a new project.

Error: Api is not returning

Hi, when i try to access the API im getting
{"error":"Could not find Trailhead ID for user: 'vwolff'. Does this profile exist? Is it set to public?"}{"error":"Could not find valid User for this handle."}

API is currently broken

Looks like Trailhead has changed some of the endpoints, will need to update the requests to fix this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.