Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [rest]

The REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

Filter by
Sorted by
Tagged with
0 votes
1 answer
33 views

setBody on HTTPCallout not working apex to stripe [closed]

I used some similar code I had done successfully in a trailhead here public class HttpCallout { @AuraEnabled public static String makePostCallout() { System.debug('----apex ...
user avatar
  • 439
0 votes
1 answer
27 views

httpcallout from apex to stripe

I'm trying to make a callout to Stripe from apex to create a customer with a test key. This just silently fails. What am I missing? public class HttpCallout { @AuraEnabled(cacheable=true) ...
user avatar
  • 439
0 votes
0 answers
28 views

Callout failed for invocable action in flow [closed]

I am trying to send an API request to the external service using flow in salesforce but when I debug my flow it returns the below error Error Occurred: Callout failed for invocable action testing3....
user avatar
1 vote
1 answer
21 views

Rest API - Which has higher priority in a SOQL query, LIMIT clause OR Sforce-Query-Options: batchSize?

When a SOQL query has both a LIMIT clause and a Sforce-Query-Options: batchSize with different but valid values, which one of these gets a higher precedence? A query with only LIMIT clause SELECT ID ...
user avatar
0 votes
0 answers
33 views

When does mc api rest for journey respond with "The contact status should be Active"

We are getting the error HTTP/1.1 400 { "message": "The contact status should be Active.", "errorcode": 30000, "documentation": "" } when ...
user avatar
  • 831
0 votes
0 answers
21 views

How to send an AL3 file (octet-stream/binary) using Rest Apex? [duplicate]

I've been trying to send an AL3 file (a custom type of file) to a Rest API. The API requires to receive the file in the form-data, I've tried many different codes but haven't been able to send the ...
user avatar
0 votes
1 answer
35 views

I try to do callout to my apex rest service from first to second dev org, but got CalloutException

String endPoint = 'https://wise-otter-ngj5eu-dev-ed.salesforce.com/services/apexrest/v1/getAccounts/'; Http h2 = new Http(); HttpRequest req1 = new HttpRequest(); req1.setHeader('Authorization','...
user avatar
  • 3
0 votes
2 answers
56 views

Retrieve all Data Extensions across all running journeys

I found out on this forum there is an option with Marketing Cloud API to retrieve all the Data Extensions associated with Journeys. When using Postman, the request below works perfectly GET /...
user avatar
  • 5
-1 votes
1 answer
42 views

A newbie's integration question - bearer token [closed]

I have two Salesforce orgs. First org has a REST web service, second org is calling the webservice. Webservice: @RestResource(urlMapping='/Johnny') global class WebServiceFactory { @HttpGet ...
user avatar
0 votes
1 answer
27 views

Sending email with template without storing data

We've set up a Apex REST endpoint to send emails on behalf of an external system. Data to fill the templates will be sent in the JSON payload to the REST endpoint. We're finding that the data is going ...
user avatar
  • 51
0 votes
0 answers
74 views

Connected App Error - { "error_description": "invalid_grant", "error_description": "expired access/refresh token" }

I've have successfully created a connected app using our sandbox account by following this Enable oauth settings api integration, However when I try to request for access_token I'm getting the follow ...
user avatar
  • 1
0 votes
1 answer
58 views

apex solution to invoke web service

I am trying to set up my first apex trigger/class but i'm having trouble interpreting and applying the docs on my usecase. Usecase: I'm trying to invoke a rest service through an apex class whenever ...
user avatar
  • 113
1 vote
0 answers
38 views

UNSUPPORTED_MEDIA_TYPE Postman Error - Salesforce Composite Request with XML Payload not working

I created a composite XML payload to update a couple of fields in Salesforce. Used POST request by hitting this REST service https://test.salesforce.com/services/data/v54.0/composite/. I tried with ...
user avatar
  • 51
0 votes
0 answers
72 views

Salesfoce REST API GET all opportunities by all owners

I have the following API request which returns opportunities. ...services/data/v54.0/query?q=SELECT FIELDS(ALL) FROM Opportunity LIMIT 20 My problem is that this call only seems to return ...
user avatar
0 votes
1 answer
49 views

HttpPost unable to parse LIST of JSON data

I'm testing this with the Salesforce workbench and I'm using /services/apexrest/myRestRequest/doPost with JSON data { "contacts": [ { "personEmail": "...
user avatar
0 votes
0 answers
47 views

Attaching a file to a 'Case' object via REST API

to start with I have defined this class in C# public class ContentVersion { public ContentVersion(string filePath) { Title = Path.GetFileName(filePath); VersionData = File....
user avatar
0 votes
0 answers
52 views

Hello, I have this lightning data table and I want to display my respond from an API but I can't figure out how to match values to the right columns

JavaScript const columns = [ { label: 'ID', fieldName: 'id' }, { label: 'image', fieldName: 'imageType' }, { label: 'title', fieldName: 'title', type: 'name' }, { label: 'ready', ...
user avatar
2 votes
1 answer
101 views

Get Suggested Articles in apex

I am trying to build a component that shows suggested articles for a given case. I would like to get the exact same suggested articles as the Knowledge component on record page gets. The rest api /...
user avatar
1 vote
2 answers
163 views

Is possible to retrieve all records on a single query?

I am using this library (forrest) to make queries in the salesforce REST API, when I do the query, it seems that salesforce returns me a pagination, I have verified it with postman as well. for ...
user avatar
0 votes
0 answers
34 views

Is it possible to avoid the 2-factor authentication after the first log in using REST API?

I'm using forrest, a library to do salesforce queries using laravel, I have this routes Route::get('salesforce/authenticate', function() { return Forrest::authenticate(); }); Route::get('...
user avatar
-1 votes
1 answer
55 views

Queuable chaining not working- First queueble doing webserivce call , second queueable should wait till result of first came

We have one use case we have to rely on external system to fetch the data and then only real time we can update the records in salesforce using values returned from webservice. we tried chaining using ...
user avatar
  • 1,277
0 votes
1 answer
35 views

Salesforce Flow Invokeable Apex making correct API call while debugging, as soon as I run the flow from custom app it doesn't work

Following code, works fine when invoked by the flow while in debug mode, but as soon as I run the flow in custom app it doesn't work. global with sharing class GovernorLimits { private class ...
user avatar
0 votes
0 answers
28 views

Correlating between users and connected apps

Iv'e managed to collect data on both users and connected apps via chatter / metadata API. However - I did not manage to find a way to correlate between the two. Is it programmatically possible to see ...
user avatar
3 votes
0 answers
74 views

UPSERT REST Api creates new record because of space(%20) urlencoding

I'm currently trying to use the salesforce UPSERT endpoint. The ExternalId that I'm using contains a space, like so: North America_12345 so my URL looks like: /services/data/v49.0/sobjects/...
user avatar
0 votes
1 answer
44 views

Is there an active Salesforce OAuth outage this morning?

It appears that multiple services were unable to oauth to salesforce this morning. I'm curious if anyone else saw this in their systems. We're not sure what's happening, it's not a credentials issue. ...
user avatar
  • 1,151
0 votes
1 answer
76 views

Web to lead True/False Considerations?

Are there any special considerations when submitting data for a Checkbox field through Web to lead endpoint? When I submit a lead with checkbox value True, it accepts the lead. When I submit a lead ...
user avatar
  • 119
0 votes
1 answer
107 views

How to get folder ID for uploading documents in Lightning?

I'm trying to use the REST API to upload a File. Eventually I want to associate this File with a specific account. I'm following these instructions to upload a binary file, where part of the body ...
user avatar
  • 1,151
3 votes
1 answer
70 views

automation/v1/filetransfers - patch endpoint not working

For a specific usecase, I need to do dynamic csv exports from SFMC to an external serveur (s3). the dataextract works well. I can browse a list of DE, modify 1 temporary dataextract activity (by ...
user avatar
0 votes
1 answer
41 views

Why isn't my DateTime field populating?

I am trying to push leads into Salesforce and I am passing in the following value... Requested_Appointment_DateTime__c=2021-12-14T18:27:33Z This format appears to match the YYYY-MM-DDTHH:MM:SSZ format ...
user avatar
  • 119
1 vote
1 answer
91 views

What is the maximum size of files/attachment in salesforce that can be created by external systems

What is the maximum size of files/attachment can be created under an object record in salesforce by an external system? As per documentation its 2 GB for files and 25 MB for attachments. https://help....
user avatar
1 vote
0 answers
22 views

Is it possible to create StandardValueSetTranslation or GlobalValueSetTranslation in Apex?

I've generated apex metadata.service.cls (sth. like this: https://github.com/financialforcedev/apex-mdapi/blob/master/apex-mdapi/src/classes/MetadataService.cls) and now I'm working on REST service ...
user avatar
0 votes
1 answer
44 views

Stub rest api test negative and positive result

I have class where using insertData() method and using stub. I want insertData stub return positive and negative results. How can i do it? Inserted data also is another method which I stub. So its ...
user avatar
0 votes
0 answers
25 views

Test class try catch on rest callout [duplicate]

So i am making post request and catch error by checking status code and by try catch too. And how can i test try catch block? I think mock response is useless here. So requst looks like: public void ...
user avatar
0 votes
0 answers
36 views

Batch rest callout error handling

I have some batch which making a post request with token and i want to handler error. Its easy to handle execute method, but can i handle errors in start with getQueryLocator?Also how can i handle ...
user avatar
-2 votes
1 answer
41 views

Check if upsert necessary

I am using external id and rest callout to another org, but is there a way to check if i need to make callout? Cause callout called even if all fields are the same. I can compare all fields, but its a ...
user avatar
0 votes
1 answer
74 views

Call External REST API from Button with Classic SFDC

I am looking to call an external REST API when a user clicks on a button in Salesforce classic. After some research I found I can use the javascript below and the content of sforce.connection....
user avatar
0 votes
1 answer
42 views

Rest upsert callout

How can i make an upsert callout? I have object Contact with custom ExtId with Custom_Object__c id. So i am tried post, patch method and without/with '?_HttpMethod=PATCH'; What do i need to do? I ...
user avatar
0 votes
1 answer
140 views

Rest api get endpoint with bind var in query

I want to bind variable in get request, but it gives me error "Bind variables only allowed in Apex code","errorCode":"MALFORMED_QUERY"}". How to do it? Account ...
user avatar
0 votes
1 answer
54 views

Rest post account record error "POST requires content-length"

So i am trying to insert some account record. Token is right because get command works well. Error while Post - POST requires content-length. I am even trying to add body with JSONGenerator. ...
user avatar
0 votes
1 answer
155 views

Implement pagination on APEX REST Endpoint without using OFFSET or LastRecordID [duplicate]

I want to be able to get a set of records independent of previous calls. So without a LastRecordID. OFFSET also doesn't do the trick as it has a limit of 2000. For example: Query contains 10000 ...
user avatar
0 votes
0 answers
88 views

Displaying Live Agent Wait Time

Trying to figure this out but I'm not too familiar with the Chat REST API and have basic knowledge of HTTP, CORS, and REST. https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/...
user avatar
1 vote
0 answers
104 views

POST .../my.salesforce.com/services/data/v51.0/sobjects/Account/ fails with 400 due CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

When using the Salesforce API and creating an account using this endpoint POST https://<mycompany>.my.salesforce.com/services/data/v51.0/sobjects/Account/ we once in a while fails with a 400 ...
user avatar
7 votes
0 answers
217 views

Best practice for establishing Salesforce as a public and secure webhook endpoint target?

We are looking at setting up our Salesforce org as a public and secure endpoint target for a 3rd party application (Housecall Pro) which will be sending us webhook calls. The only rub is they cannot ...
user avatar
0 votes
2 answers
52 views

Test Class Cannot Find @RestResource Web Service Class

I have a @RestResource web service class that works fine in the real world, and works fine from Workbench, and its test class runs without errors, yet the test class does not actually run the web ...
user avatar
  • 628
0 votes
0 answers
146 views

connection to salesforce with curl, no response

As a followup of windows curl authentication error, i'm doing the tutorial on https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_webservices?trail_id=...
user avatar
0 votes
1 answer
173 views

Updating MobileConnect Subscription Opt In Status via REST API

I am trying to create an automation activity (SSJS) that would opt out or opt in a subscriber at a keyword level. I am using the code below and was able to run it in Automation Studio without errors. ...
user avatar
  • 1
0 votes
1 answer
40 views

automatic switch over on integration

I am working on quote object integration but customer is not ready to provide end point details. Instead of that asking me to integrate with temporary mock system and do end to end testing. They are ...
user avatar
-1 votes
1 answer
568 views

Error: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]

Myclass public with sharing class soapServiceApexClass { @future(callout=true) @AuraEnabled public static void createSOAPWebSevice(Integer x, Integer y){ ...
user avatar
0 votes
1 answer
329 views

Callout from an LWC page

Hi Have a below code in apex Http http = new Http(); HttpRequest request = new HttpRequest(); string accessToken; request.setEndpoint(URL); request.setMethod('POST'); HttpResponse response = http.send(...
user avatar
  • 2,225
0 votes
0 answers
44 views

Create web hook to connect salesforce to google campaign

I'm trying to create a web-hook listener to create a new Lead when a form is filled out through google ads. Google has an option to use web-hooks to connect to CRM. https://imgur.com/a/CCxZxJj I ...
user avatar

1
2 3 4 5
17