<script>
var URL = 'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=MY_KEY'
const req = new Request(URL,{
method : "POST",
headers : new Headers({
"Content-Type" : "application/json"
}),
context: {
"longDynamicLink" : "https://MY_DOMAIN.page.link/?link=EXAMPLE_LINK",
"suffix" : {
"option" : "SHORT"
}
}
});
var response = fetch(req).then(res=>res.json()).then(json => console.log(JSON.stringify(json)));
</script>
I want to make shortlink. My longDynamiclink is working so I send request, but I received the following response.
{code: 400
message: "Unsupported dynamic link request DYNAMICLINK_NOT_SET.[https://firebase.google.com/docs/dynamic-links/rest#create_a_short_link_from_parameters]"
status: "INVALID_ARGUMENT"}
Is there a problem with my code? Or did I make the wrong request? Please let me know how I can fix my code to get the correct response.
thanks.