Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export API / Periodic Export? #166

Closed
imbriaco opened this issue Oct 13, 2016 · 7 comments
Closed

Export API / Periodic Export? #166

imbriaco opened this issue Oct 13, 2016 · 7 comments

Comments

@imbriaco
Copy link

First of all, thank you for creating the cla-assistant. I've evaluated many of these tools and this is definitely the best available option in my experience.

I'm wondering if there is any way to periodically export the contributor CSV other than manually logging in through the web UI? It seems like exposing an API endpoint that I could fetch an export from would be the easiest path, but I wasn't able to find anything that like that from a quick look through the code.

@KharitonOff
Copy link
Contributor

Thank you for your positive feedback!
There is an API that gives you the list of signed CLAs (not in csv format, but as JSON). The only Problem is: you need a Session ID.
I'll rewrite the authentication part to provide the possibility to access APIs with username and github token.

@KharitonOff
Copy link
Contributor

Now you can use the POST API /api/cla/getAll to collect all signed CLAs for your repo. You have to provide following parameters in the request body:
repoId and gist.gist_url as json e.g.:

{
"repoId":"51002973",
"gist":{
        "gist_url": "https://gist.github.com/96ef0a16f11c8f11b41c"
       }
}

For authentication you can use a valid github token. You can provide it either as a body-field token or as a header-field x-token.
Would this solution help you?

@imbriaco
Copy link
Author

The API request makes sense, though I'm not sure how I would go about getting the GitHub token. I'm assuming that you specifically mean a token for the cla-assistant OAuth application? Could the cla-assistant web UI expose that somewhere?

@KharitonOff
Copy link
Contributor

You can use your "personal github token". If you go to settings in your github profile you can generate a github token under "Developer settings -> Personal access token". We use it only for identification towards GitHub.

@imbriaco
Copy link
Author

I didn't even realize you could choose the scopes when you created a personal access token and I used to work at GitHub. Derp! Yes, this will work great. Thanks so much!

@imbriaco
Copy link
Author

Actually, one more question @KharitonOff -- can I use orgId instead of repoId?

@imbriaco
Copy link
Author

Nevermind, tested it for myself and it works great. I really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants