0

I want to use hub to create some automation script but can't figure out how to post a message to the api. More specifically it is this api endpoint I want to post to: https://developer.github.com/v3/users/gpg_keys/#create-a-gpg-key

I've tried the following:

  1. hub api user/gpg_keys -F armored_public_key='-----BEGING PGP ....'
  2. hub api user/gpg_keys --raw-field "body={armored_public_key='-----BEGING PGP ....'}

None of the above work, the response back is:

{"message":"Not Found","documentation_url":"https://developer.github.com/v3/users/gpg_keys/#create-a-gpg-key"}

which is not very helpful. I thought that -F meant fields within the payload, but I guess I'm wrong.

So how do I post a message with a body using hub api?

UPDATE

I did download the repo to create a modified version that has some more logging, but can't figure out what's wrong. Everything looks good from what I understand in how the request is made.

Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137

1 Answers1

0

Looking through the code I found the reason to why this is. It seems like it is hard coded that you should only get the repo scopes when you log in the first time. If you use a token you've created yourself that has more access everything will work as it should.

Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137