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

Returing a JS file #2

Closed
mbardelmeijer opened this issue Jul 6, 2020 · 2 comments
Closed

Returing a JS file #2

mbardelmeijer opened this issue Jul 6, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mbardelmeijer
Copy link

mbardelmeijer commented Jul 6, 2020

Hey, awesome service. Question: could the response be modified to return a javascript file that sets the token?

So for instance:

<script src="https://ig.instant-tokens.com/users/XXXXXXXXXXXXXXXXXXXXXXXXX/instagram/XXXX/token.js"></script>
-> returns var InstagramToken = 'TOKENXXXXXXXXXX';

Then on the page, we can include this JS:
See example of <script src='https://(your-token-app-name).herokuapp.com/token.js'></script>

And the variable is set directly without needing to do a ajax request:
<script>alert(InstagramToken);</script>

@codingbadger codingbadger self-assigned this Jul 17, 2020
@codingbadger codingbadger added the enhancement New feature or request label Jul 17, 2020
@codingbadger
Copy link
Owner

I have updated the API to handle this. As requested the response sets a variable called InstagramToken to the value of the current Access Token.

The end point to use in your script tag is in the format of:

https://ig.instant-tokens.com/users/{userId}/instagram/{instagramUserId}/token.js?userSecret={userSecret}

I'll update the wiki and site in the next week or so.

@codingbadger
Copy link
Owner

The site has no been updated to display this information

image

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

No branches or pull requests

2 participants