Can’t generate Installation Access Token

I followed this documentation to generate an installation access token but I getht this response:

{
“message”: “Not Found”,
“documentation_url”: “https://developer.github.com/v3/apps/#create-a-new-installation-token
}

I have a feeling the issue might be with my instalaltion_id. Can anybody confirm where I should get this?

Hi @paul-carron,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.

Cheers!

curl -i -X POST \
> -H “Authorization: Bearer token” \
> -H “Accept: application/vnd.github.machine-man-preview+json” \
> https://api.github.com/installations/13631156/access_tokens
HTTP/1.1 404 Not Found
Server: GitHub.com
Date: Mon, 12 Mar 2018 13:08:56 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 125
Status: 404 Not Found
X-GitHub-Media-Type: github.machine-man-preview; format=json
Access-Control-Expose-Headers: ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src ‘none’
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
X-Runtime-rack: 0.017574
X-GitHub-Request-Id: FCDF:33E6:845AB63:F3253A1:5AA67BE8

{
  “message”: “Not Found”,
  “documentation_url”: “https://developer.github.com/v3/apps/#create-a-new-installation-token
}

There you go.

I suspect I may not have the correct installation_id in my URL. I used owner.id which I got from here:

curl -i -H “Authorization: Bearer token” -H “Accept: application/vnd.github.machine-man-preview+json” https://api.github.com/app
HTTP/1.1 200 OK
Server: GitHub.com
Date: Mon, 12 Mar 2018 12:47:44 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1389
Status: 200 OK
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: “3e5af20afa747c7ee416bc063a413a04”
X-GitHub-Media-Type: github.machine-man-preview; format=json
Access-Control-Expose-Headers: ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src ‘none’
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
X-Runtime-rack: 0.020248
X-GitHub-Request-Id: FA40:33E4:3F632C5:8358375:5AA676F0

{
  “id”: xxxx,
  “owner”: {
    “login”: “MyOrg”,
    “id”: xxxx,
    “avatar_url”: “https://avatars3.githubusercontent.com/u/xxxx?v=4”,
    “gravatar_id”: “”,
    “url”: “https://api.github.com/users/PCTestOrg”,
    “html_url”: “https://github.com/PCTestOrg”,
    “followers_url”: “https://api.github.com/users/PCTestOrg/followers”,
    “following_url”: “https://api.github.com/users/PCTestOrg/following{/other_user}”,
    “gists_url”: “https://api.github.com/users/PCTestOrg/gists{/gist_id}”,
    “starred_url”: “https://api.github.com/users/PCTestOrg/starred{/owner}{/repo}”,
    “subscriptions_url”: “https://api.github.com/users/PCTestOrg/subscriptions”,
    “organizations_url”: “https://api.github.com/users/PCTestOrg/orgs”,
    “repos_url”: “https://api.github.com/users/PCTestOrg/repos”,
    “events_url”: “https://api.github.com/users/PCTestOrg/events{/privacy}”,
    “received_events_url”: “https://api.github.com/users/PCTestOrg/received_events”,
    “type”: “Organization”,
    “site_admin”: false
  },
  “name”: “IBM Stocator Test Runner - DEV”,
  “description”: “This is a DEV app for running multiple test types against the IBM Stocator connector.”,
  “external_url”: “https://github.com/PCTestOrg/stocator”,
  “html_url”: “https://github.com/apps/ibm-stocator-test-runner-dev”,
  “created_at”: “2018-02-22T12:47:16Z”,
  “updated_at”: “2018-03-12T12:05:17Z”
}

If this is incorrect, where should the installation_id come from?

In order to list your application installations, including the installation ID used for this endpoint, use the /app/installations endpoint documented here: https://developer.github.com/v3/apps/#find-installations