Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Upload file to secure connection - sessionToken is absent or invalid (DBSQ261)

Hi All,
I switch my DB to use secure connection, and since than I'm getting the following issue:
While trying to upload file to DB I'm getting the following error:

Error: {"message":"Option 'Secure collection with session token' enabled but sessionToken is absent or invalid","code":"DBSQ261"} at Object.query (:25:42) at Object.query (:43:35) at getAllCollection (:54:24) at prepreJSONForSaveIntoTable (:432:29) at :31:28

In the header I tried event to set all permission combination:
"headers": {
"X-Appery-Database-Id": dbId,
"X-Appery-Master-Key": masterKey,
"X-Appery-Session-Token": token,
"content-type":"text/json"
},

Can you tel what is the issue?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Upload file to secure connection - sessionToken is absent or invalid (DBSQ261)

Hi -

Are you passing session token in your headers?

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Upload file to secure connection - sessionToken is absent or invalid (DBSQ261)

Yes,
Here is the method:

insertJSONInfoFilesTable = function(jsonObjToStore, fileName, dbId, masterKey, token){
var XHRResponse = XHR.send("POST", "https://api.appery.io/rest/1/db/files/"+ fileName + ".json", {
"headers": {
"X-Appery-Database-Id": dbId,
"X-Appery-Master-Key": masterKey,
"X-Appery-Session-Token": token,
"content-type":"text/json"
},

Code: Select all

   "body": jsonObjToStore 

});
};

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Upload file to secure connection - sessionToken is absent or invalid (DBSQ261)

Above code if fine, the issue was that I missed to add the token inside inner method.

Thanks!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Upload file to secure connection - sessionToken is absent or invalid (DBSQ261)

Hello Yaniv,

Thank you for the update, glad it works!

Return to “Issues”