dwyl / learn-flutter

🦋 Learn how to use Flutter to Build Cross-platform Native Mobile Apps
https://flutter.dev
GNU General Public License v2.0
73 stars 8 forks source link

Giphy Invalid authentication credentials #37

Closed miguelmartins17 closed 1 year ago

miguelmartins17 commented 4 years ago

Still getting the same error , even after changing the API key. Trying to understand how can I get the credentials right.

Screen Shot 2020-02-13 at 20 55 49

nelsonic commented 4 years ago

@miguelmartins17 this is how I would record this issue:

Giphy error

An error occurred.
GiphyClientError{statusCode: 403, 
exception: {"message":invalid authentication credentials"}
}

That way other people facing this issue will find this issue when they Google and they will also discover your (eventual) solution to the problem.

miguelmartins17 commented 4 years ago

@nelsonic I've tried to find the solution to this mistake, but all the solutions none of them happened with Flutter.

nelsonic commented 4 years ago

@miguelmartins17 keep sharing comments for what you are trying. youtu.be/yKYK1xt-kKo Remember to git push the code you have written to GitHub so that others can help you debug. We have many examples of "debugging threads" on GitHub e.g: https://github.com/dwyl/learn-devops/issues/19 Each comment shows the step the person has taken while attempting to solve a challenge. Comments == Effort (more comments means more effort. keep trying and sharing what you try)

miguelmartins17 commented 4 years ago

@nelsonic I'm trying to see if the problem was the API key so I went to https://developers.giphy.com/ to get a new one and try again.

miguelmartins17 commented 4 years ago

So apparently the problem wasn't with the API key.

nelsonic commented 4 years ago

And ... what was the problem? The suspense is killing me. suspense

miguelmartins17 commented 4 years ago

@nelsonic I haven't figured it out yet to show images of but to show the gif not. I've been looking at these two articles but I can't find a solution.

For the gif animations: https://pub.dev/packages/gif_ani#-readme-tab-

https://pub.dev/packages/giphy_picker

nelsonic commented 4 years ago

Cool. keep going. you're almost there. 👨‍💻

miguelmartins17 commented 4 years ago

@nelsonic This is complex. 😕

kennethbrent commented 4 years ago

I don't know if this will help anyone else but I was getting the same response from giphy

Object { "message": "Invalid authentication credentials", }

After almost breaking my computer i realized I did not add an ampersand after my API key before i declared the next URL parameter.

This works const BASE_URL = 'http://api.giphy.com/v1/gifs/search'; const resJson = await fetch(${BASE_URL}?api_key=${API_KEY}**&**q=${this.state.search}&limit=20

This did not and caused the error const BASE_URL = 'http://api.giphy.com/v1/gifs/search'; const resJson = await fetch(${BASE_URL}?api_key=${API_KEY}q=${this.state.search}&limit=20

nelsonic commented 4 years ago

@kennethbrent thanks for sharing! ☀️