HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How do I use the article alias feature

I am trying to link to an article that has an alias associated with it. I have not been able to find any documentation on how this is done.

Here is what I have done so far:

Step 1: Created an Article by posting it to the /articles API:

curl -X 'POST' \
  'https://mysubdomain.vanilladevelopment.com/api/v2/articles' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-transient-key: mykey' \
  -d '{
  "body": "demo",
  "draftID": 0,
  "format": "text",
  "knowledgeCategoryID": 512,
  "name": "Article Title"
}'

I received positive confirmation that an article was created:

{
  "articleID": 987,
  "articleRevisionID": 1348,
  "knowledgeCategoryID": 512,
  "breadcrumbs": [
    {
      "name": "Learners",
      "url": "https://mysubdomain.vanilladevelopment.com/english/kb/documentation-learners"
    }
  ],
  "knowledgeBaseID": 4,
  "name": "Article Title",
  "body": "demo",
  "outline": [],
  "excerpt": "demo",
  "seoDescription": null,
  "seoName": null,
  "slug": "987-article-title",
  "sort": 14,
  "score": 0,
  "views": 0,
  "url": "https://mysubdomain.vanilladevelopment.com/english/kb/articles/987-article-title",
  "insertUserID": 9,
  "dateInserted": "2022-08-19T13:34:33+00:00",
  "updateUserID": 9,
  "dateUpdated": "2022-08-19T13:34:33+00:00",
  "status": "published",
  "featured": false,
  "dateFeatured": null,
  "locale": "en",
  "translationStatus": "up-to-date",
  "foreignID": null
}

Step 2: Created an alias to the article using the articles/{id}/aliases API

curl -X 'PUT' \
  'https://mysubdomain.vanilladevelopment.com/api/v2/articles/987/aliases' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-transient-key: mykey' \
  -d '{
  "aliases": [
   "andy"
  ]
}'

I received positive confirmation that the alias was created:

{
  "articleID": 987,
  "articleRevisionID": 1348,
  "knowledgeCategoryID": 512,
  "breadcrumbs": [
    {
      "name": "Learners",
      "url": "https://mysubdomain.vanilladevelopment.com/english/kb/documentation-learners"
    }
  ],
  "knowledgeBaseID": 4,
  "name": "Article Title",
  "body": "demo",
  "outline": [],
  "excerpt": "demo",
  "seoDescription": null,
  "seoName": null,
  "slug": "987-article-title",
  "sort": 14,
  "score": 0,
  "views": 0,
  "url": "https://mysubdomain.vanilladevelopment.com/english/kb/articles/987-article-title",
  "insertUserID": 9,
  "dateInserted": "2022-08-19T13:34:33+00:00",
  "updateUserID": 9,
  "dateUpdated": "2022-08-19T13:34:33+00:00",
  "aliases": [
    "andy987"
  ],
  "status": "published",
  "featured": false,
  "dateFeatured": null,
  "locale": "en",
  "translationStatus": "up-to-date",
  "foreignID": null
}

My question is how do I refer to the alias (i.e. andy) from within another article? I have tried:

https://mysubdoamin.vanilladevelopment.com/english/kb/articles/andy
https://mysubdoamin.vanilladevelopment.com/english/kb/andy
https://mysubdoamin.vanilladevelopment.com/andy
 and none of these work.


Tagged:

Answers

  • KasparKaspar Moderator
    "aliases": [
        "andy987"
      ],
    



  • How does one refer to "andy987". I am looking for how I formaluate the URL.
    
    


  • KasparKaspar Moderator

    You tried

    https://mysubdoamin.vanilladevelopment.com/english/kb/articles/andy
    https://mysubdoamin.vanilladevelopment.com/english/kb/andy
    https://mysubdoamin.vanilladevelopment.com/andy
    

    but the alias says andy987



    otherwise just use redirects

    https://success.vanillaforums.com/kb/articles/232-route-management-redirects

  • Yes, the andy987 was a typo when I was typing the question. But the question does still stand. I have tried:

    https://mysubdoamin.vanilladevelopment.com/english/kb/articles/andy987
    https://mysubdoamin.vanilladevelopment.com/english/kb/andy987
    https://mysubdoamin.vanilladevelopment.com/andy987
    
    and 
    https://mysubdoamin.vanilladevelopment.com/english/kb/articles/andy
    https://mysubdoamin.vanilladevelopment.com/english/kb/andy
    https://mysubdoamin.vanilladevelopment.com/andy
    
    and they did not work.
    
    I am looking for the URL that would work.
    


Sign In or Register to comment.