scala - Access token exception instagram with working access token? -
i'm having trouble http request scala code.
https://api.instagram.com/v1/tags/training?access_token=workingaccesstoken
gives
{"meta":{"code":200},"data":{"media_count":872874,"name":"training"}}
which want.
when try code like:
val data = ws.url("https://api.instagram.com/v1/tags/training?access_token=sameworkingtoken").get() val body = data.get().getbody()
gives
{"meta":{"error_type":"oauthparameterexception","code":400,"error_message":"\"client_id\" or \"access_token\" url parameter missing. oauth request requires either \"client_id\" or \"access_token\" url parameter."}
which not want. i'm tired , dont know doing wrong here? should go other solution? i'm stuck , appreciate answers problem. btw. i'm doing request local, maybe problem? thanks!
when ran code, got exception indicating access token not valid (expected). if plug in valid token should work:
import play.api.libs.ws.ws import scala.concurrent.await import scala.concurrent.duration._ object wstest { def main(args: array[string]) { val data = ws.url("https://api.instagram.com/v1/tags/training?access_token=sameworkingtoken").get() val resp = await.result(data, 5 seconds) println(resp.body) } }
Comments
Post a Comment