Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest-api]

REpresentational State Transfer (REST), or RESTful, web services provide interoperability between computer systems on the Internet. The Salesforce REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

0
votes
0answers
7 views

Creating public ContentVersion via REST API on behalf of someone else fails

I am creating simple interface for posting new Case feed posts (FeedItem objects). These posts are created by admin on behalf of other users (altering the CreatedById field). I'd like to support also ...
1
vote
1answer
17 views

Suppressing password generation when creating community user with API

I want to use the Salesforce API (REST or SOAP) to provision new Community Cloud Users. I have successfully invoked the API and created the user account, however the transaction automatically ...
0
votes
1answer
16 views

Debug logs for failed REST API calls

I'm debugging an issue where our customer's iOS app (which makes REST API calls to Salesforce via the SDK) is encountering data sync errors. We believe the API is returning error messages but they are ...
1
vote
1answer
15 views

multipart/form-data, No mapping found for HTTP request for URI

I want to make a multipart/form-data request call using apex. to make this working i took a reference from How can I compose a multipart/form-data request? I want two files to be sent over the ...
0
votes
0answers
17 views

Marketing cloud new Transactional Messaging API

In the last Marketing Cloud release there is the new transactional messaging API option (https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/transactional-messaging-api.htm). ...
-1
votes
0answers
20 views

JSON Error: Starting position out of bounds: -1 [on hold]

I have a code where the JSON will be extracted using a certain end point. This JSON contains Parent to Grandchild like Structure where Parent is Bundle, Child is Item and GrandChild is Component. When ...
0
votes
1answer
12 views

Marketing Cloud new Transactional API - Error while activating definition

My MC account just got enabled on the new transactional email API which was "released" a couple weeks ago. I'm following the documentation here. The POST to create the definition returns returns an ...
-4
votes
0answers
20 views

What are SSL Certificates and how to use them? How to use SSL certificates to communicate to external secure webservices? [on hold]

docSample.DocSamplePort stub = new docSample.DocSamplePort(); stub.clientCertName_x = 'Certificate Name'; // <<< Salesforce’s certificate name String output = stub.InvokeWebservice();
0
votes
1answer
29 views

how to provide username and password in test method for REST API

apex.runtime.impl.ExecutionException: pad block corrupted if (req.headers.get('username') != null&&req.headers.get('password')!=null && Authorization.decrypt(req.headers.get('...
2
votes
0answers
21 views

What does 'scope' mean in the context of a Salesforce report? Where/how is it specified? What are the possible (API) values?

There is a method called getScope() in ReportMetadata Class. Can someone please shed some light on what 'Scope' actually means? Where/how is it specified? What are the possible (API/system-digestible) ...
0
votes
2answers
26 views

How to authenticate REST API without going through login page?

I would like to allow end-users that do not have access to Salesforce directly to be able to make orders (a custom object) by submitting a form from a web page. I would have thought making a simple ...
1
vote
1answer
54 views

Marketing Cloud REST API “Not Authorized” error in Postman

Am doing a POST REST API call out from Postman to insert a record in Data extension. Below are the steps: Step 1: POST --> https://s50.auth.marketingcloudapis.com/v1/requestToken Body --> { ...
-3
votes
1answer
27 views

SOQL Query -REST API [closed]

I would like to know if it is possible to insert or update records using a SOQL query in the REST API. thanks
1
vote
1answer
23 views

How to read the error from the response given by Salesforce

I have an api that has a catch method: catch (Exception e) { // Error System.debug('API - ERROR: ' + e.getMessage()); res.responseBody = Blob.valueOf('ERROR: ' + e.getMessage()); res....
1
vote
0answers
27 views

Display a PDF in Salesforce from Blob data

For our project, we need to get a PDF via API from an external private filestore, and display it within a Lightning Component. With the blob that is returned, if I set that to the src of an iFrame, it ...
1
vote
0answers
25 views

ExactTarget REST API - Cloud Pages & Collections

I've successfully used the available REST API in order to create various assets in Marketing Cloud / ExactTarget, like HTML Emails, Templates and Landing Pages. The email assets are visible under the ...
1
vote
2answers
28 views

Sharepoint Integration From Apex

We need to upload files to sharepoint and able to view the uploaded files to sharepoint in salesforce. So we cant achieve this in File Connect, where it is not supporting two way synchronisation. So ...
0
votes
1answer
20 views

Best way to store a value easily editable by apex

I want to store a text value that I can easily modify using apex. I want to use it to change the behaviour of a visual flow depending of the value in this field. I think about custom metadata type ...
0
votes
1answer
22 views

pad block corrupted apex Crypto

I am facing an issue while decryption of value which is stored in custom setting. When i encrypt and decrypt value at same time then i that error is not thrown, if i get the value from custom setting, ...
0
votes
1answer
20 views

System.QueryException: value of filter criterion for field 'CreatedDate' must be of type dateTime

Below my code, I want to pass date value as a parameter but I facing an error as below, message: System.QueryException: value of filter criterion for field 'CreatedDate' must be of type dateTime and ...
2
votes
2answers
21 views

See Event Logs of other users

We're currently blasting through our SFDC daily API limits and I wanted to see who is causing it. As per the trailhead I went into the Event Log File viewer they offer (salesforce-elf.herokuapp.com) ...
0
votes
0answers
18 views

How to send data which increases after the base64 encoding?

I'm trying to send an attachment through api call, my file size is 4.5mb which increases to more than 6mb after base 64 encoding. and it start throwing error of 6 mb limit which salesforce support for ...
0
votes
1answer
31 views

Data Extension synchronous Rest API where there are only primary keys

I have a data extension with 2 fields/attributes. These 2 fields are string types and primary keys. According to documentation the request body for synchronous APIs request should be: https://...
-3
votes
0answers
27 views

how to write the test class for this part of code [duplicate]

@RestResource(urlMapping='/orderCreation/*') global class WebShopOrderCreation { @HttpPost global static void PostData(){ RestRequest req = RestContext.request; RestResponse res = ...
0
votes
2answers
34 views

Searching contacts by Rest API

In my app(outside Salesforce) I want to show search results from Salesforce contacts. The search is based on contact name. While I can do it by using SOQL query using Rest API, I'm worried about ...
0
votes
1answer
30 views

Get Object id using rest api

Is ther any unique id available for object. If yes, How to get a object's unique id ie.object_id using rest api.
0
votes
1answer
10 views

Automation Studio create activities via REST API

I need to create and save an activities with REST API in Automation Studio. How can I do it? many thanks
0
votes
0answers
25 views

PlatformActionList consuming API calls

I'm having trouble dealing with my API calls limit. I found that the main object that is consuming this API calls is PlatformActionList (I'm not a developer, I'm not even sure if this is an object). ...
1
vote
0answers
24 views

Bulk API 2.0 Upload for files bigger than 150Mb

I'm trying to use the Bulk API 2.0 to upload big files. I need to know how I have to upload the data in case the file converted to base64 exceeds the 150Mb allowed. After reading the documentation I'...
0
votes
1answer
29 views

facing error as “This session is not valid for use with the REST API” while integration with PHP platform

I want to create lead record using integration of php platform. I have written rest API for that. The code is working fine when tested on workbench. But now I have integrated salesforce with PHP ...
0
votes
1answer
21 views

View Logs from API calls made externally

In the developer console, I am only able to view the logs of an API call that I made from within the developer console (tests) or from workbench. But when I make a call from Postman, I do not see any ...
0
votes
0answers
19 views

Can I use @Httppost and @Httpput on the same method

I want to use 1 method regardless of whether the request is sent as a Post or Put (upsert). So, if the request has an Id field populated, it will update the record, if not it will insert. Can I just ...
0
votes
1answer
36 views

Salesforce Unauthenticated REST - HTTP 301

I followed this tutorial, http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/ , to create a public rest service in a developer sandbox. If I run any of the following: ...
0
votes
0answers
24 views

How can I use pre-request script in salesforce?

I have a pre-request script and an endpoint which I can use to fetch access token in postman. How can I use the same script in Salesforce to get the access token?
0
votes
1answer
13 views

getting recursion for Salesforce 2 Salesforce Integration using REST API in Case object

I am doing salesforce to salesforce integration between two orgs using REST API. I created REST API classes in two different org that update/insert/delete records. Insert and Delete works fine. But in ...
0
votes
0answers
21 views

Retrieving Automation using SOAP API from SFMC

I want to retrieve Automation, together with its activities, from Marketing Cloud using SOAP API. So far, here is what i've done: POST request: https://mccjt21lv-4lgq9nyyffr29q3v31.soap....
0
votes
0answers
41 views

How to Create a List (via APIs) from a Large CSV in Marketing Cloud

I wrote some code to interact with Marketing Cloud's SOAP API to create a List and populate Subscribers by importing a CSV file. The code works fine for CSVs up to a couple of thousand records. I ...
0
votes
2answers
20 views

Bulk match contacts based on email

I've a list of email ids and I want to match it against contacts in Salesforce. I'm planning to do use SOQL like - Select Id, Name from Contact where email IN ('a@xyz.com, b@xyz.com') I will be ...
1
vote
2answers
28 views

Deserialize JSON Body into two different Lists of own classes

I'm writing an REST PUT request that takes in an array of Careers and Degrees from the body and converts them to inner classes within the RestResource class. However, when I am attempting to ...
1
vote
0answers
26 views

Rest Api deprecation

When a salesforce rest api version will be deprecated? Is there any validity period for api version? Is there any deprecation process salesforce follows?
1
vote
1answer
131 views

Rest api version v45.0 not working

Rest apis below version v45.0 working fine. But new version v45.0 is not working. Getting error as [ { "errorCode": "NOT_FOUND", "message": "The requested resource does not exist" ...
1
vote
1answer
49 views

Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API

I'm using PATCH /composite/sobjects URI as stated in the REST API Developer Guide. But I'm receiving this error: Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API ...
0
votes
1answer
51 views

Reading in XML from webserivce request using HttpRequest

I have seen multiple posts online talking about how to read in XML data from a web request using HttpRequest, but I cannot seem to make it work or find any documentation on it. The closest I have ...
0
votes
0answers
39 views

Getting Bad request for Connected App

I am using Connected app to authorize the access token but I am getting bad request. here is my code. public static void test(){ String clientId = 'REDACTED'; String clientsecret = '...
0
votes
2answers
46 views

Check API REST Salesforce

I have a test class of REST API and I want check this. In workbench it is OK, but now I want check and use with other application. Can I check this class? I have tried with cURL, but I do not get it; ...
0
votes
0answers
14 views

Upload PDF from Files (Content Document) to External Server using REST API

I have a requirement where every new PDF uploaded under Files for Accounts should be automatically posted to an External Server using REST API. Any resources on how this can be done?
1
vote
1answer
110 views

Salesforce Rest API create account

We are using the Salesforce Rest API to integrate our external website with Salesforce Sales Cloud. When a user registers on our website, we create a contact record in Salesforce. The response to ...
0
votes
2answers
48 views

Redirect following POST method

I have a scenario : A user needs to fill a form and after submitting, it should send the data of the form using POST API to some URL - the user will need to be redirected to this page after the ...
0
votes
1answer
22 views

External Website integration with Salesforce

We have an external website that is integrated with Salesforce via REST API. On the website, when a user registers, a contact record is created and also a welcome email is sent right away. Users ...
0
votes
1answer
25 views

How to Insert or Update Blob Data using Workbench

Bascially I'm trying to execute the example given here for the upload of Blob Data from Workbench. but on executing I'm getting below error: message: Unexpected character ('C' (code 67)): expected a ...