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.

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

Deserialization using Apex class generated using JSON2Apex gives null for inner values

I have the following piece of code. @RestResource(urlMapping='/Update') global with sharing class OpportunityUpdate { @HttpPost global static void updateOpportunity() { RestRequest req = ...
0
votes
0answers
19 views

Setting a Scheduled Automation to Active with REST API

I can activate scheduled automations through soap but only if their schedule is not already configured. Does anyone know how to activate a scheduled automation through REST API? I think the "isActive" ...
0
votes
0answers
10 views

OCAPI request length restriction

if I send a PATCH request for a customer resource (.../customers/xyz) with the following data: {"birthday":"11.11.1980","email":"max@mustermann.de","first_name":"Max","last_name":"Mustermann","title":...
0
votes
0answers
11 views

Connect external application with my Salesforce app

We are developing an external application which will connect to a Salesforce app (also being developed by us) for data integration. Now this Salesforce app can be installed by any organization, so I ...
-4
votes
1answer
28 views

Getting 2 days previous date [closed]

I am storing user inputted date in dd/mm/yyyy in variable not custom field. How do i then go to two days back on inputted date. I have a variable 'd' which contains dd/mm/yyyy.
-2
votes
1answer
23 views

Apex Test class for following soql [duplicate]

How do i write test class for the following SQOL SELECT LeaveDate,FullName,Worklocation,Email FROM object WHERE Leavedate = LAST_N_DAYS:30
0
votes
0answers
10 views

LiveAgent availability check by live_agent_rest_estimated_wait_time Details are below

I need small support on this I currently have Omni Channel implementation. I have developed custom UI for Pre Chat and its working but proceeding further I need two things How can I extract field ...
1
vote
0answers
21 views

Salesforce SAML Assertion flow via REST API for Lightning Out

Context: We want to log a user into a Lightning Out App hosted on an Azure AD System using the SAML Assertion flow. What we have establisched so far: We have a functioning connection for our ...
0
votes
0answers
15 views

How to keep logs of API endpoint consumption by 3rd party or user [closed]

I want to keep track of the date time when my API was called and user who consumed my API endpoint.
0
votes
0answers
14 views

REST API Callout with Named Credentials not refreshing token?

I am making a call from my org to the REST API of another org to pull in some data from the chatter feed API. I set up a connected app on the org of the API I am using. It is using the OAuth scopes (...
0
votes
0answers
25 views

SetObjectProperty: how to create inline objects

I have the following 'To' object in an API request: "To": { "Address": "email address here", "SubscriberKey": "Subscriber key here", "ContactAttributes": { "...
1
vote
1answer
15 views

No result from EventLogFile for Event Type = ReportExport

I am sure that we are exporting reports but there are no result when I use this query: SELECT Id,EventType,LogDate,LogFileLength,LogFile FROM EventLogFile WHERE EventType ='ReportExport' I also ...
1
vote
2answers
28 views

Methods defined as TestMethod do not support Web service callouts on working test class [closed]

I'm experiencing a wierd thing, I'm made a deployment on a refactoring of code on cases this monday (2019.12.02) and my test classes use the Test.setMock method. It worked so I started doing the same ...
0
votes
1answer
25 views

Unable to identify REST API status code

I am testing a REST service in dev console and I'm getting a status of Found and a status code of 302. However, the body is empty and I know the parameter value returns a record from the system that I'...
2
votes
1answer
49 views

Controlling Journey Builder custom activity exit time based on DE update completion

We have developed a custom activity that returns the date and should populate DE/ This date is used in Wait by attribute activity which follows custom activity. The problem we face is that we receive ...
0
votes
1answer
21 views

Pagination REST API, Multiple request, DML End problem

I was share 1 more question before in my profile, and i changed my apex code, My old question. Now i wrote my callout function in batch apex class, My problem is when i want to send second request ...
0
votes
1answer
24 views

RAML connection setup in salesforce [closed]

Can anyone please help me in setting up raml connection in salesforce? We have RAML file shared to us which has details of external system. But we dont know the steps to establish connection using ...
1
vote
0answers
27 views

SOSL using POST REST /parameterizedSearch API

I got the "/services/data/v46.0/parameterizedSearch" POST API working for a complex SOSL search I want to perform. I am referring to the Salesforce documentation here: https://developer.salesforce....
-2
votes
0answers
22 views

Is there some Trailhead API? [duplicate]

The Endpoint return only html. I want to restore points, badges and trails in Trailhead, but after change web site trailhead, it is no longer possible. public class RESTGetHttpContentCallout { ...
0
votes
0answers
35 views

REST API Create Multiple Records

Create multiple records with reference to the official documentation:Create multiple documentation url But I need to fill the lookup field value, I found the official document again:update ...
3
votes
0answers
26 views

How to merge two records via REST?

Both Apex and SOAP APIs provide a method to merge two records of a mergeable type (e.g., Account, Contact). Is there any way to access this functionality from a REST API? I've checked the docs and ...
0
votes
0answers
32 views

How can i use pagination to in GET Request (REST API)

Firstly i want to update some fields in my products object, I was wrote API in my server for the products informations. In my Json data have a lot of records getting from the MSSQL Server, Thats why i ...
0
votes
0answers
17 views

API call to Sharepoint from AURA using a system user

I am calling an API service to receive a list from Sharepoint (url) via a component (controller/helper .js) using req.open("GET", url, true); Now I need to always call this service under a specific ...
1
vote
1answer
32 views

Rest api Read Timed Out for large dataset

I have a rest request (user initiated via a lwc button) to an Azure Function that gets sent a masterId and followerId which contacts are assigned to. The Azure function uses a SOSL query. It will send ...
2
votes
1answer
25 views

ApexREST Websrvice StatusCode with ResponseBody

I am writing a REST Webservice and have the following piece of Code. @RestResource(urlMapping='/UpdateTransaction') global with sharing class OpportunityTransaction { @HttpPost global static ...
1
vote
1answer
120 views

How to download a attachment in browser using JSForce?

I am trying to download a Attachment using JSForce library. I am able to get body of attachment and download that file but somehow content of downloaded file is not correct and I am getting a corrupt ...
1
vote
1answer
64 views

Rest API Method

Does the REST API support querying mobile push demographics? How to retrieve mobile push demographics data for a given contact key ? I searched the documentation https://developer.salesforce.com/...
0
votes
0answers
5 views

Is there a way for a third party widget to access prechatDetails (passed by live agent chasitorInit REST API) later on?

We have a widget which we'd like to embed in a visual force page as an iframe. This widget would like to make a call to Salesforce to retrieve certain preChatDetails that were passed by a separate app ...
8
votes
1answer
86 views

Which date format to use with inputs for the Quick Actions REST API? (INVALID_TYPE_ON_FIELD_IN_RECORD)

I'm receiving the error INVALID_TYPE_ON_FIELD_IN_RECORD when invoking a custom sobject quick action to create a record and its payload specifies a Date or DateTime field as an input value. For ...
0
votes
0answers
19 views

OCAPI and its usage with SFCC

I am really new to the concept of RESTful APIs, OCAPI and there usage with the Commerce Cloud. I have the following questions. Please help me out as I might be really stuck: I am trying to fetch a ...
0
votes
1answer
28 views

Building Salesforce Applications using the Salesforce API

I am creating a salesforce deduping application using python. The issue I am running into is that deduping applications literally take hours to run through large databases. How do others execute ...
1
vote
1answer
24 views

How to prevent a records from being returned in response to a Web Service call if they have been sent in the previous call?

How to prevent a records from being returned in response to a Web Service call if they have been sent in the previous call? @RestResource(urlMapping='/Demo/*') global class ...
1
vote
1answer
19 views

Special Characters handling in REST API SOQL C# HttpClient

My Setup. C#.net Project, Rest Api to Salesforce Dev Org. Received Error on following Query SELECT ID FROM PRODUCT2 WHERE ProductCode = 'M5Z55UP#ABC' <?xml version=\"1.0\" encoding=\"UTF-8\"?>\...
1
vote
1answer
37 views

Getting JSON_Parser_error when using Sfdc.canvas.client.ajax to Create multiple records using REST API

I am trying to insert 2 records at a time using canvas client in a connected app, using REST API, code and response below: Sfdc.canvas.client.ajax('/services/data/v47.0/composite/sobjects',{ "...
0
votes
3answers
50 views

Error Handling in REST Webservice

I have exposed this Apex class as a webservice. So far so good, as I get the response when this Webservice is called from ARC or POstman. @RestResource(urlMapping='/ProcessAccount/*') global with ...
2
votes
1answer
39 views

How can I use REST API through OAuth?

For test purposes, I'm trying to use some customer's REST API on Salesforce. I don't have any API-consuming code yet (I'm just using CURL, OAuthDebugger, et similia). I've tried the following this ...
0
votes
1answer
41 views

How to create a child record from parent when external id is updated on parent record?

There are 2 objects Account(Parent) and Connect(Child) which lookup relationship. When I create an Account, we make a call out where we send the account records to third party application and in ...
0
votes
1answer
26 views

Salesforce cURL Example with Session ID is not working

I'm trying to use the Salesforce Rest API with the session ID I received via a SAML Response from the same Salesforce Instance (as IDP) but I get the message: [{"message":"This session is not ...
5
votes
0answers
71 views

Calling Marketing Cloud REST API via webhook

I'm trying to work out a means of calling Salesforce Marketing Cloud's REST API via a third party webhook to write to a data extension. The issue I'm having involves refreshing the oauth token. We've ...
3
votes
1answer
69 views

Is it possible to discover a sandbox version with a API request to a sandbox?

We built and are enhancing a "Salesforce Sandbox Manager" to allocate Salesforce sandboxes to our Jenkins CI/CD and occasionally facilitate other sandbox management tasks. We'd like our manager to ...
0
votes
1answer
28 views

errorCode“: ”APEX_ERROR“, ”message“: ”System.NullPointerException: Argument cannot be null

If i pass date i am able to execute first if condition but if parameter is not passed in URL from postman, i am getting Null pointer exception error. RestRequest restReq = RestContext.request; ...
1
vote
1answer
22 views

SFDX plugin to generate Apex classes from Swagger file is failing to install

I'm trying to install this plugin https://github.com/muenzpraeger/sfdx-plugin , due to some reason it is failing. Please let me know if there is any other way that i can generate classes using swagger ...
0
votes
0answers
48 views

REST API Call using Activity in Marketing Cloud - activity error

I'm trying to authenticate to an external service in Marketing Cloud to generate a URL to review a product in Trustpilot. This is my first time trying to write a SSJS script, so I followed the ...
0
votes
1answer
35 views

Creating user initiated email send definition through API

I am able to create email send definitions through SOAP API but not through REST API. Through SOAP API I can only create definitions having classic emails and not content builder emails. Through Rest ...
0
votes
0answers
13 views

Querying ContentFolderItem through REST API only returns first 500 items and next page is empty

I have a very simple SOQL query: SELECT Id, IsFolder, ParentContentFolderId, Title FROM ContentFolderItem WHERE ParentContentFolderId IN ('ContentWorkspace.RootContentFolderId','ContentWorkspace....
0
votes
0answers
12 views

Get ContentWorkspace folder and file hierarchy in one query

I need to find the cheapest way to get all data about content and folders in ContentWorkspace in terms of the number of REST API calls (aka SOQL queries). Suppose i have a basic tree like so: My Lib ...
2
votes
1answer
31 views

How do I get client Id and redirect URI from salesforce without having access to an sfdc org

I'm trying to understand OAuth flow by building a chrome extension. I need access to the user's org and the way to do that authorization is via a connected app. Well what do you need for a ...
0
votes
1answer
30 views

Composite REST Resource Not Found

I created a composite REST to insert opportunity for existing account, but all the GET method return error resource not found.. someone help { "allOrNone" : true, "compositeRequest" : [{ "method" ...
0
votes
0answers
9 views

Is it possible to populate ServiceAppointmentHistory in tests? [duplicate]

I'm working on an application that has an HTTP endpoint where clients should be able to get the history of the Status for a ServiceAppointment. This history is available in the ...
1
vote
2answers
68 views

How would third party app generate access token with just Consumer Key and Consumer Secret?

Created a Connected App and got the Consumer Key and Consumer Secret Created a RST API Webservice in Salesforce (by exposing Apex Class as a REST WEbservice Installed 'Advanced REST Client' Plugin in ...