Hello Everyone! i am working with restlets Get req...
# general
z
Hello Everyone! i am working with restlets Get request is working fine but if i want to create a record of custom record type using post request i'm getting "INSUFFICIENT PERMISSION" Error. { "error": { "code": "INSUFFICIENT_PERMISSION", "message": "{\"type\":\"error.SuiteScriptError\",\"name\":\"INSUFFICIENT_PERMISSION\",\"message\":\"Permission Violation: You need the \'Lists -> Documents and Files\' permission to access this page. Please contact your account administrator.\",\"id\":\"\",\"stack\":[\"Error\n at suitescript/resources/javascript/record/recordImpl.js4012\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js3824)\n at suitescript/resources/javascript/record/recordImpl.js2629\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js2424)\n at Object._post (/SuiteScripts/Restlet/restlet.js1232)\"],\"cause\":{\"type\":\"internal error\",\"code\":\"INSUFFICIENT_PERMISSION\",\"details\":\"Permission Violation: You need the \'Lists -> Documents and Files\' permission to access this page. Please contact your account administrator.\",\"userEvent\":null,\"stackTrace\":[\"Error\n at suitescript/resources/javascript/record/recordImpl.js4012\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js3824)\n at suitescript/resources/javascript/record/recordImpl.js2629\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js2424)\n at Object._post (/SuiteScripts/Restlet/restlet.js1232)\"],\"notifyOff\":false},\"notifyOff\":false,\"userFacing\":true}" } }
c
It tells you what to do in the error message
💯 1
j
Check the role that is accessing the RESTlet.
s
Just add the "Documents and Files" permission to the role used or run the script as admin.