GET HTTP 404 error while trying to access MarketPlace endpoint

Hi! So I am trying to access this endpoint here:

Basically, I would like to check whether or not a user is actively subscribed to one of the my app’s plans.

But unfortunately, I keep on receiving this as an error message: “Octokit::NotFound - GET 404 - Not Found // See:”

I’m coding in Ruby, using the official Octokit library. Here’s my code:

def marketplace_listing
      #random account id
      account_id = 123456
      endpoint = "/marketplace_listing/accounts/#{account_id}"
      stubbed_endpoint = "/marketplace_listing/stubbed/accounts/#{account_id}"

      results = @app_client.get(endpoint) # Returns 404 Not Found error.

def authenticate_app
payload = {
          # The time that this JWT was issued, _i.e._ now.

          # JWT expiration time (10 minute maximum)
          exp: + (10 * 60),

          # Your GitHub App's identifier number
          iss: APP_IDENTIFIER

      # Cryptographically sign the JWT.
      jwt = JWT.encode(payload, PRIVATE_KEY, 'RS256')

      # Create the Octokit client, using the JWT as the auth token.
      accept = 'application/vnd.github.machine-man-preview+json'
      headers = { 'Accept' => accept}
      @app_client = jwt, headers: headers)

I’ve tried replacing the endpoint with the stubbed endpoint, and it works fine. 

The documentation mentioned that requests that require authentication will return 404 Not Found, but I don’t know exactly is wrong.

If I’m understanding correctly what you’re doing, the documentation states also that you’ll get a 404 Not Found when the account has not purchased the listing. Given that you’re using a random account ID, I would assume that the random account ID has not purchased your listing and 404 would be the expected response.

Let me know if I’ve misunderstood.


That was the problem. Thank you!