Update Task varibales

When I try to update task variables as a file type variable through ReST API it shows success.
But when I try to retrieve it,I find the variable value to be null.
Am I missing anything.

Request:

URI : {{baseURL}}/rest/engine/default/task/{{taskId}}/variables

Request Body:
{
“modifications”: {
“attachment”:{
“type”:“file”,
“value”:“Base64 encoded string”,
“valueInfo”:{
“filename”:“Camunda Doc”,
“mimetype”:“text/plain”,
“encoding”:“UTF-8”
}
}
}
}

This is successfully executed.

But when I try to retrieve it using the following API
GET : {{baseURL}}/rest/engine/default/task/{{taskId}}/variables

I get the following response.

{“attachment”: {
“type”: “File”,
“value”: null,
“valueInfo”: {
“encoding”: “UTF-8”,
“filename”: “Camunda Doc”
}
}
}

Is there anything else to be done?

why are you using the endpoint
/rest/engine/default/task/{{taskId}}/variables
instead of
/rest/task/{{taskId}}/variables

Either way it gives the same response.