# Shorten\_url api does not return urlId

**URL:** <https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342>\
**Category:** Kibana\
**Created:** [October 26, 2020, 4:20pm UTC](https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342 "2020-10-26T16:20:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tshayan](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tshayan](https://discuss.elastic.co/u/tshayan)\
**Post date:** [October 26, 2020, 4:20pm UTC](https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342/1 "2020-10-26T16:20:20Z")

</div>

Hello,

I have followed the [shorten\_url api](https://www.elastic.co/guide/en/kibana/master/url-shortening-api.html) documentation to create a new shortened URL, however in response I am only getting a confirmation and not the urlID as per the documentation.

I am doing this via Kibana's dev-tools:

Request:

```
POST /api/shorten_url
{
  "url": "/app/dashboards#/view/1d73b1f0-fe7d-11ea-9dd2-93882e373ff0?_a=(description...."
}

```

Response:

```
#! Deprecation: [types removal] Specifying types in document index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, or /{index}/_create/{id}).
{
  "_index" : "api",
  "_type" : "shorten_url",
  "_id" : "3JqrZXUByUcARzs8PpFk",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 7,
  "_primary_term" : 1
}

```

Also no new URL object gets created under saved objects. Could anyone help?

Using ELK 7.9.2

---

<div class="post-metadata">

**Author:** ![tshayan](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tshayan](https://discuss.elastic.co/u/tshayan)\
**Post date:** [October 27, 2020, 4:12pm UTC](https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342/2 "2020-10-27T16:12:12Z")

</div>

Update:  
If I do this using curl from command line it works and returns the urlId.... But still curious why is isn't the same response from dev-tools.

I am assuming this is because dev-tools sends the command towards elasticsearch while with curl we send the command towards kibana (curl localhost:5601/api/shared\_url) which basically tells me thath this is a kibana API and not an ES API. Is that correct?

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [October 27, 2020, 7:54pm UTC](https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342/3 "2020-10-27T19:54:17Z")

</div>

Hey, you nailed it! Dev tools can only be used for Elasticsearch APIs, to test Kibana APIs you need to use an external tool like curl.

`/api/shorten_url` is a Kibana API (check the first breadcrumb of the navigation in the docs, if it says 'Kibana Guide', it's a Kibana API).

The confusing part here is `POST /api/shorten_url` is also a valid Elasticsearch query - it adds a document of type "shorten\_url" to the "api" index.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 24, 2020, 7:54pm UTC](https://discuss.elastic.co/t/shorten-url-api-does-not-return-urlid/253342/4 "2020-11-24T19:54:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
