function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hari Kumar EnagantiHari Kumar Enaganti 

REST API service URI Not working from Postman/other REST Clients,but working fine with Workbench

Am trying to Insert/Upload a File(Base64) from Rest Client by mentioning
https://mysalesforce-instance.com/services/data/v48.0/sobjects/ContentVersion by giving Body as
 
{
"Title":"New Upload",
"PathOnClient":"NewUpload.JPG",
"ContentLocation":"S",
"OwnerId":"<My Id>",
"VersionData":"file base64 information"
}

Passing headers with the
Authorization access token
Content-type apllication/json;charset=UTF-8

I can able to get response from Workbench, but when I have done this in Postman/ARC am getting ContentVersion object description like below. but not getting successful ID. Kindly let me know is there any thing I need to do.
 
{
    "objectDescribe": {
        "activateable": false,
        "createable": true,
        "custom": false,
        "customSetting": false,
        "deepCloneable": false,
        "deletable": false,
        "deprecatedAndHidden": false,
        "feedEnabled": false,
        "hasSubtypes": false,
        "isInterface": false,
        "isSubtype": false,
        "keyPrefix": "068",
        "label": "Content Version",
        "labelPlural": "Content Versions",
        "layoutable": true,
        "mergeable": false,
        "mruEnabled": false,
        "name": "ContentVersion",
        "queryable": true,
        "replicateable": false,
        "retrieveable": true,
        "searchable": true,
        "triggerable": true,
        "undeletable": false,
        "updateable": true,
        "urls": {
            "compactLayouts": "/services/data/v48.0/sobjects/ContentVersion/describe/compactLayouts",
            "rowTemplate": "/services/data/v48.0/sobjects/ContentVersion/{ID}",
            "defaultValues": "/services/data/v48.0/sobjects/ContentVersion/defaultValues?recordTypeId&fields",
            "describe": "/services/data/v48.0/sobjects/ContentVersion/describe",
            "layouts": "/services/data/v48.0/sobjects/ContentVersion/describe/layouts",
            "sobject": "/services/data/v48.0/sobjects/ContentVersion"
        }
    },
    "recentItems": []
}

 
AbhishekAbhishek (Salesforce Developers) 
You are using the wrong HTTP method. If you perform an HTTP GET to 

/services/data/v48.0/sobjects/ContentVersion, you will obtain the response body shown.

This is the sObject Basic Information (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_basic_info.htm) endpoint. To create a record, you should be using POST.


I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
Hari Kumar EnagantiHari Kumar Enaganti
@Abhishek Tried with Post method and Body as JSON format,I only received object description rather than file saved response.
Get method results in 'We are down for maintenance' like this strange error.
AbhishekAbhishek (Salesforce Developers) 
I am not using Postman, but my experience is that making an invalid POST request gets you a completely different error.