```/** *@NApiVersion 2.1 *@NScriptType restlet ...
# suitescript
r
Copy code
/**
 *@NApiVersion 2.1
 *@NScriptType restlet
 */
define([], function() {
    function getRecord(context) {
        return { msg: 'hello World' };
    }

    return {
        get: getRecord
    };
});
☝️My restlet code
b
use 2.0
r
error code: INVALID_RETURN_DATA_FORMAT
error message: {"type":"error.SuiteScriptError","name":"INVALID_RETURN_DATA_FORMAT","message":"Invalid data format. You
should return TEXT.","stack":["createError(N/error)"],"cause":{"name":"INVALID_RETURN_DATA_FORMAT","message":"Invalid
data format. You should return TEXT."},"id":"","notifyOff":false,"userFacing":true}
error changed
b
if this is your first restlet, you want to read SuiteScript 2.0 RESTlet Script Type
the content type matters
r
Thanks. It is super helpful. It working now 🙂
Are you a NS developer ?