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
3
votes
1answer
14 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 ...
0
votes
1answer
26 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 ...
0
votes
1answer
33 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....
0
votes
0answers
23 views

Rest Response size limit in Salesforce lightning components

We have a requirement to show images from external system on Lightning component using real time API call. If we do call out with apex, heap size limitation of (6MB) is applicable. Can we fetch the ...
1
vote
0answers
17 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 ...
0
votes
1answer
38 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 ...
0
votes
0answers
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 ...
0
votes
0answers
27 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 ...
-2
votes
1answer
39 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 ...
0
votes
1answer
18 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....
0
votes
1answer
28 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 ...
0
votes
1answer
32 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 ...
0
votes
1answer
18 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. ...
0
votes
1answer
47 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 ...
0
votes
0answers
33 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/...
1
vote
0answers
59 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 ...
7
votes
0answers
90 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 ...
0
votes
2answers
41 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 ...
0
votes
0answers
72 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=...
0
votes
1answer
57 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. ...
0
votes
1answer
36 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 ...
-1
votes
1answer
158 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){ ...
0
votes
1answer
145 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(...
0
votes
0answers
30 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 ...
0
votes
0answers
49 views

How to handle live agent custom events through the native chat-core sdk's

We are integrating an instant chat with live agents in a React Native application, utilising the native chat-core sdk's for both Android and iOS. The plan is to route customers through the same setup ...
0
votes
0answers
75 views

REST image upload returning empty json body

Trying my first rest API call with SSJS. I'm trying to upload an image as per this guide https://sfmarketing.cloud/2020/02/29/create-a-cloudpages-form-with-an-image-file-upload-option/ On my landing ...
0
votes
0answers
59 views

Apex REST - GET with body fails in Summer '21 release

Our sandbox got updated to Summer '21 release. Now sending any payload (body) to @RestResource via GET method returns this HTML We are down for maintenance. I can't find anything about it in the ...
1
vote
0answers
22 views

REST update fail, REST insert work

I have this strange issue. I have opened up REST requests using a read only user in a sandbox, all work fine. The request can post an insert in cases and send an update to changes status etc. I then ...
0
votes
1answer
32 views

Insert Record with Rest api and one wrong field

when insert a record into salesforce and the JSON file contains one field from backend, which may not yet be in Salesforce, is it possible, that the record will be created with the correct field and ...
0
votes
1answer
248 views

Stripe API request working with Postman but failing with Apex Rest Callout

I'm trying to make a callout to a Stripe Api with Apex. I made the exactly same request in Postman with the same Http configuration and have this working well. But when running it with Apex i get a ...
0
votes
0answers
28 views

Test Class covering only 75% coverage .How to increase coverage for this test class [duplicate]

@RestResource(urlMapping='/convertlead/*') global with sharing class LeadConvertRestAPI{ public class ApplicantDetails { public String Application_Id; public String Applicant_Id; ...
0
votes
1answer
40 views

Inserting custom metadata [duplicate]

I'm using REST api towards Salesforce for inserting various kinds of data from our other systems. And for data that is regarded as configuration (in this case a list of freight forwarders) we have ...
0
votes
2answers
47 views

REST API Integration Error: Invalid conversion from runtime type List to Map\n\n(BMCServiceDesk)

I am creating an integration to open a Service Request in my salesforce instance (remedyforce application). I created the file below, I've had several errors and corrected it until I didn't give any ...
0
votes
0answers
50 views

Error 401 when calling a rest api from javascript

I'm working on an integration of a web page that will consume a rest service to create a service request (in the BMC Heli xRemedyforce application) When I run the rest on Postman, it's going smoothly, ...
0
votes
1answer
36 views

Do a post callout and get the location header from rest service class

I have a requirement and I am not sure is it possible or not. My requirement is that I have a rest service class with @httpGet annotation where I am getting Id of a record after that I need to do rest ...
1
vote
0answers
47 views

Upsert in @Restresource Apex POST Method [closed]

I've a custom @Restresource Apex service created with POST Method. I want to perform upsert based on an external id field. I receive record in json format from external system, I create a new record ...
0
votes
1answer
48 views

Unable to convert incoming JSON request body to string JSON - Salesforce

I am creating a post method that is tested with Postman and I do get the functionality done which is getting a variable from the incoming JSON string then querying a record, then updating the account ...
0
votes
0answers
12 views

Why isn't Salesforce Einstein OCR working with public links hosted by my domain?

I am currently working on integrating Einstein OCR functionality to detect the content of a certain .pdf or .jpg file. The issue I'm facing regards the inability of the API to access documents that ...
0
votes
0answers
40 views

Why is my assignment rules not being adhered to in new profile?

I am using the Salesforce REST API to create Leads in my system, I have one active Lead assignment rule. The user I have authenticated with has minimal acccess to Salesforce, allowing REST and access ...
1
vote
2answers
404 views

Salesforce Platform API Versions 7.0 through 30.0 Retirement

I received an email from Salesforce for the withdrawal of two features (Salesforce Platform API Versions 7.0 through 30.0 Retirement ): https://help.salesforce.com/articleView?siteLang=en_US&id=...
1
vote
0answers
41 views

Any way to use the SFMC integrated Bitly link shortner within a Transactional SMS API JSON payload? [duplicate]

I created a Transactional SMS Send Definition via REST API (Transactional API), and am able to send SMS via API just fine. Is there any way to shorten a dynamic link that is passed in to the API via ...
1
vote
0answers
29 views

How to get instance name/key via API for sandbox Org

I have gone through all previous answers, I found this useful How to get instance name/key via API The rest API https://api.status.salesforce.com/v1/instanceAliases/[custom-domain] works only for ...
0
votes
1answer
82 views

How to get category (folder) Id of SSJS activities

I tries to create SSJS activity using REST API. Body of request looks like this: { "name": "ActivityName", "key": "ActivityKey", "...
0
votes
0answers
261 views

Getting response in Postman but getting 503 error in salesforce for API request

I am getting a 503 error on sending API request via developer console. The same when sent through Postman gives me response. I am new to API using salesforce. I have added the remote site settings in ...
0
votes
0answers
50 views

SOQL Query via REST API does not allow AttachedContentDocument filter for Community User only

I have added a custom field My_Field__c which is a picklist to ContentVersion. If I run the query as an admin, I can get AttachedContentDocuments via that field e.g. like so SELECT Id, Name, (SELECT ...
0
votes
0answers
118 views

How to retry the callout on http request timed out in rest apex callouts? [duplicate]

Below is the code. Can anyone tell how to implement retry logic when the 2 minutes http request get timed out. public static void sendOptyInfo(Set <Id> oppIdSet) { try{ for (...
0
votes
0answers
60 views

How do I get the API specification or schema for a custom REST endpoint?

How do I get the API specification or schema for a custom REST endpoint? I'm looking for something basic, similar to the examples provided within this documentation for OpenAPI Specification. The end ...
0
votes
1answer
203 views

How to replace _id with id in a JSON response using REST API?

I am making a GET callout to the URL: https://th-superbadge-apex.herokuapp.com/equipment?_ga=2.245262661.1986105727.1612691455-984520333.1610882684. In the URL, the id field starts with _id which I ...
0
votes
0answers
23 views

RestResource Get URL [duplicate]

I have a Rest Web Service class that exposing Get Function. I am trying to get the entire URL of the request to save it in logs. According to the Salesforce Documentation I could get it, without ...
0
votes
0answers
76 views

How to access Platform Cache using REST API

I have a requirement to retrieve available resource and consumed resources for Platform Cache outside my salesforce org. I was wondering if we can use REST API to retrieve this result ? Given a try by ...

1
2 3 4 5
17