I’m using Open Cloud DataStore API to Set Entry
inside my datastore. I am definitely connected to my datastore since I have been able to make other requests such as List DataStores
.
I’m using Axios and Node.JS/ExpressJS to make my request.
var id = "3021566345"
var key = "blablabla"
var datastore = "Test101"
var setkey = "setentrytest"
var setvalue = "500"
const url = "https://apis.roblox.com/datastores/v1/universes/" + id + "/standard-datastores/datastore/entries/entry"
axios.post(url, {
params: {
datastoreName: datastore,
entryKey: setkey,
},
headers: {
"x-api-key": key,
"content-type": "application/json",
"content-md5": crypto.createHash("md5").update(JSON.stringify(setvalue)).digest("base64")
}
}).catch((error) => {
console.error(JSON.stringify(error))
})
The error I am receiving is 401 Bad Request
{"message":"Request failed with status code 401","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout
":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/0.27.2","
Content-Length":214},"method":"post","url":"https://apis.roblox.com/datastores/v1/universes/3021566345/standard-datastores/datastore/entries/entry","data":"{\"params\":{\"datastoreName\":\"Test101\",\"entryKey\":\"setentrytest\"},\"headers\":{\"x-api-key\":\"blablabla\",\"content-type\":\"application/json\",\"content-md5\":\"WouTp69uN91F2j37PdD5IA==\"}}"},"code":"ERR_BAD_REQUEST","status":401}
Thanks in advance for any help👍