You need to sign in to do that
Don't have an account?
Pedram Saleh
Querying VersionData from ContentVersion returns URL when querying using React Native SDK
I'm trying to query VersionData to get a base64 representation of a file. It works in workbench (I get a really long field), but when I query it in my React Native sample app created with forceios (using SDK 4.3) I just get the following as the result:
/services/data/v36.0/sobjects/ContentVersion/{id of file}/VersionData
When I paste that URL into REST Explorer and do a get, I just get:
Raw Response
1
If I log into salesforce.com and paste that url after the .com, I get the following:
Any idea why this could be and how to get the data I want? Thanks.
/services/data/v36.0/sobjects/ContentVersion/{id of file}/VersionData
When I paste that URL into REST Explorer and do a get, I just get:
Raw Response
1
If I log into salesforce.com and paste that url after the .com, I get the following:
<Errors> <Error> <errorCode>INVALID_SESSION_ID</errorCode> <message>Session expired or invalid</message> </Error> </Errors>
Any idea why this could be and how to get the data I want? Thanks.
Not sure how to do it in the React Native app, since that was created using forceios.
/services/data/v37.0/query/?q=SELECT+VersionData+FROM+ContentVersion
When I run the exact same query from the Workbench SOQL query tool it gives me the data I want.
Even using the SobjContainer component in React Native gives me Description, FileType, ID, OwnerID, TagCsv, Title, __shortID, _soupEntryID, _soupLastModifiedDate - and the attributes of CompactTitle, shortID, type, and url. Basically everything except VersionData.