Skip to content

Instagram: Support passing in API url #6398

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

Merged
merged 3 commits into from
Mar 22, 2020

Conversation

maravilhosinga
Copy link
Contributor

Instagram API was updated.

Old API is not working anymore.

New docs are listed here: https://developers.facebook.com/docs/instagram-basic-display-api/

Instagram API was updated.
@codecov
Copy link

codecov bot commented Feb 10, 2020

Codecov Report

Merging #6398 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #6398    +/-   ##
========================================
  Coverage   93.98%   93.98%            
========================================
  Files         169      169            
  Lines       11687    11828   +141     
========================================
+ Hits        10984    11117   +133     
- Misses        703      711     +8     
Impacted Files Coverage Δ
src/Adapters/Auth/instagram.js 100.00% <100.00%> (ø)
src/GraphQL/loaders/schemaDirectives.js 88.88% <0.00%> (-5.56%) ⬇️
src/GraphQL/loaders/parseClassMutations.js 98.96% <0.00%> (-1.04%) ⬇️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.79% <0.00%> (-0.69%) ⬇️
src/ParseServer.js 91.07% <0.00%> (-0.50%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 96.74% <0.00%> (-0.28%) ⬇️
src/RestWrite.js 93.81% <0.00%> (-0.17%) ⬇️
src/Controllers/DatabaseController.js 95.19% <0.00%> (-0.11%) ⬇️
src/Config.js 89.60% <0.00%> (ø)
src/triggers.js 92.94% <0.00%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da0dbfe...b65be8a. Read the comment docs.

@davimacedo
Copy link
Member

Thanks for the PR. Do they have any "test api" that we can use in our tests so we can make sure that it is always working?

@maravilhosinga
Copy link
Contributor Author

maravilhosinga commented Feb 10, 2020

Old api is not working, i made tests.

new api can be tested directly from browser also.

https://graph.instagram.com/me?fields=&access_token=IGQVJWQ21jTS0zZAkNLbGJvcDIwQnMxcWk3M016Q1pQLTd1SjdRVW9hTjhtTzQwMDNhSG8xV05EQzlVRGhTQURxV1lQU2tfb3N2VzVURk11WDlZAblJiLU52RHlXbzh5dzNHQzV3UWZA3

I updated access_token, just for test purposes.

@davimacedo
Copy link
Member

I've noticed that Instagram is not allowing anymore to setup new projects to use the old style but it is still working for the ones that have it already setup. I'm afraid to update it here and some apps stop working. Maybe we should support both apis. @dplewis what do you think?

@dplewis
Copy link
Member

dplewis commented Feb 11, 2020

I would support both. Perhaps add api url to the AuthData to specify which API is used.

@davimacedo
Copy link
Member

@maravilhosinga would it be possible to be changed?

Instagram API was updated and is not allowing anymore to setup new projects to use the old style but it is still working for the ones that have it already setup.

New docs are listed here: https://developers.facebook.com/docs/instagram-basic-display-api/

I've added support for both old and new API
To use new API just add new field "api_type" = "new_api" in client side.

For old API just no changes needed.
Copy link
Contributor Author

@maravilhosinga maravilhosinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to support both instagram API version, old and new.

@maravilhosinga
Copy link
Contributor Author

@davimacedo i have updated to support both old and new API. please check.

Copy link
Member

@dplewis dplewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick change and we should be good. Can you revert the styling?


// A promisey wrapper for old api requests
function requestOld(path) {
return httpsRequest.get('https://api.instagram.com/v1/' + path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were referring to passing in the api endpoint. This way if a new endpoint is release we won't have to update the server again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that not everyone is able to know witch endpoint to pass, that solution will be complicated most of devs or just Parse Server lovers.

for example i sell sources code on codecanyon.net and almost 80% of buyers, are not developers, they use to follow documentations to setup their apps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old api will be defaulted (if no endpoint is passed in). If you want to use a newer endpoint pass it in. This will also enable backwards compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@dplewis
Copy link
Member

dplewis commented Mar 22, 2020

@maravilhosinga Thanks for getting started on this. Feel free to test the changes I made by passing in apiURL into your authData

@davimacedo @acinader How does this look?

@dplewis dplewis changed the title Update instagram.js Instagram: Support passing in API url Mar 22, 2020
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dplewis dplewis merged commit b60502d into parse-community:master Mar 22, 2020
dplewis added a commit to parse-community/docs that referenced this pull request Mar 22, 2020
@SebC99
Copy link
Contributor

SebC99 commented Mar 27, 2020

The new Instagram documentation indicates:

Instagram Basic Display is not an authentication solution. Data returned by the API cannot be used to authenticate your app users or log them into your app. If you need an authentication solution we recommend using Facebook Login instead

Does that mean that Instagram Auth Adapter (with the new url) can't be used anymore for signup?
Thanks

TomWFox pushed a commit to parse-community/docs that referenced this pull request Apr 8, 2020
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

Successfully merging this pull request may close these issues.

5 participants