Skip to content

Getting “Integration not found” when using app id returned from /orgs/{org}/installations endpoint #165

@rpivovar-godaddy

Description

@rpivovar-godaddy

If this is the wrong place to post this issue, happy to post this elsewhere --

I’m trying to instantiate Octokit with authStrategy createAppAuth with an app ID that I’ve retrieved by using the /orgs/{org}/installations endpoint. I used this endpoint by instantiating Octokit using a personal access token.

After listing installed apps, I could see the app in the returned JSON list that I wanted to use for the createAuthApp authStrategy. I copied its app ID from the app_id field.

I then went into the settings for the app and generated a brand new private key.

For testing purposes, I’ve stored my private key in my js file like this:

const privateKey = `
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
`.trim()

I then try to instantiate Octokit with the private key and the app ID.

const appOctokit = new Octokit({
  authStrategy: createAppAuth,
  auth: {
    appId: 1,
    baseUrl, // I'm using this same baseUrl when instantiating with personal access token
    privateKey
  }
});

Then I try to make a request to the /app endpoint with this new instance:

const { data } = await appOctokit.request('/app');
console.log(data);

I get this error, though: RequestError [HttpError]: Integration not found

After creating a private key for an app ID that appears to exist when using the /orgs/{org}/installations endpoint, it appears that I can’t find the app when instantiating with the createAppAuth helper.

Am I doing something wrong here?

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: SupportAny questions, information, or general needs around the SDK or GitHub APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions