A
A
Alexey1112019-09-15 23:40:17
API
Alexey111, 2019-09-15 23:40:17

How long does the Yandex Weather API activate?

I created an API, chose a test rate, I try to get the url, but I get {"message":"Forbidden","status":403}
How long does it take to activate?

import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

public class MainClass {
    public static void main(String[] args) {

        try {
            HttpResponse<JsonNode> jsonResponse
                    = Unirest.get("https://api.weather.yandex.ru/v1/forecast?lat=55.75396&lon=37.620393&extra=true")
                    .header("accept", "application/json").queryString("X-Yandex-API-Key", "b4b1d000-8790-4e0b-afcc-738172390e3f")
                    .asJson();
            System.out.println(jsonResponse.getBody());
        } catch (UnirestException e) {
            e.printStackTrace();
        }
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question