Firebase动态链接创建失败

时间:2019-04-12 20:53:57

标签: firebase firebase-dynamic-links

我是Firebase的新手,并且遇到了最基本的问题。我似乎无法获得基本的api调用来创建动态链接。我只是想创建一个没有android / ios引用的缩短的网址。

这是我的api调用:

POST:  https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=[apiKey]
BODY:  {
   "longDynamicLink": "https://mycustomsubdomain.page.link/?link=https://docs.google.com"
}

我收到以下错误消息:

 {
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"{\n   \"longDynamicLink\": \"https://mycustomsubdomain.page.link/?link\": Cannot bind query parameter. Field '{\n   \"longDynamicLink\": \"https://mycustomsubdomain' could not be found in request message.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid JSON payload received. Unknown name \"{\n   \"longDynamicLink\": \"https://mycustomsubdomain.page.link/?link\": Cannot bind query parameter. Field '{\n   \"longDynamicLink\": \"https://mycustomsubdomain' could not be found in request message."
          }
        ]
      }
    ]
  }
}

1 个答案:

答案 0 :(得分:0)

我假设您使用的是REST API?

尝试一下(没有身体):

{3,5}