500 error while adding tags using Rest Api

Showing results for 
Search instead for 
Did you mean: 
Member II

500 error while adding tags using Rest Api


I am hiting below post method to add a tags.


request body-



"status": {
"code": 500,
"name": "Internal Error",
"description": "An error inside the HTTP server which prevented it from fulfilling the request."
"message": "09300061 Wrapped Exception (with status template): 093065371 Error during processing of the template 'The following has evaluated to null or missing:\n==> tags [in template \"org/alfresco/repository/tagging/node.tags.post.json.ftl\" at line 2, column 16]\n\nTip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??\n\nThe failing instruction:\n==> #list tags as tag [in template \"org/alfresco/repository/tagging/node.tags.post.json.ftl\" at line 2, column 9]'. Please contact your system administrator.",
"exception": "",
"callstack": [],
"server": "Community v5.2.0 (re21f2be5-b22) schema 10,057",
"time": "Oct 30, 2018 3:07:02 PM"

please help me to resolve the error.

1 Reply

Re: 500 error while adding tags using Rest Api

This POST works fine for me using postman. Maybe you are not specifying the content-type header with a value of "application/json"?

If you are specifying the header and it still isn't working, please share your code, or, better yet, a curl command.

For example, this works:

curl -uadmin:admin -XPOST "http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/6ab3e90c-24ef-47cf-abc7-af112e..." -H "content-type: application/json" -d"['test2']"