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
1
vote
1answer
27 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
44 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
55 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
47 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
53 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
35 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
97 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
77 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
35 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
37 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
69 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
49 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
26 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
30 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
46 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
39 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
184 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 ...
3
votes
2answers
125 views

Marketing Cloud API Get Contacts Who Are Not in Any Channel

I have about 25,000 contacts who are not in Email, SMS or any known channel. I need to completely remove them from the system, but you can't query for them since they are not in a channel. I'm trying ...
0
votes
1answer
27 views

Can't Consume POST request but Dev Console shows url is being hit with requests

Afternoon, We have a vendor that is trying to send POST requests to a method in we have hosted using Site Guest User. Here is our code snippet that we are using to see if the request is even ...
0
votes
0answers
38 views

Multiple callouts dependant on each other in an InvocableMethod

I have an InvocableMethod apex function being called from Flow in which I make a total of 8 Web Callouts. They are all dependant on each other - so web callout 2 uses params returned by web callout 1 ...
1
vote
1answer
82 views

Using API call in SSJS

I would like to know if we can do an API call Using SSJS. My need is to extract data from a data extension and target an end point using API call. The SSJS is unfortunlly not documented very well. I ...
0
votes
0answers
191 views

The 'Content-Type' header must be modified using the appropriate property or method.\r\nParameter name

I am making a Http get request to 3rd party api using SSJS. each time i make a call is get below exception: e: {"message":"An error occurred when attempting to evaluate a Util.HttpRequest call. See ...
0
votes
2answers
31 views

Hitting API call limits

We are hitting our API usage limit for the last 2 days and we are getting REQUEST_LIMIT_EXCEEDED. We are not able to figure out what/which app is making all the calls. All our known apps don't even ...
1
vote
1answer
17 views

How to get info about which sobject a report refers to?

I have a few reports based on subjects (e.g. Opportunity, Lead, Account) and need to get info about these subjects. I tried to use url: GET "/services/data/<version>/analytics/reports/<...
0
votes
1answer
70 views

PATCH request, always get 404 Not Found response

I am trying to update a value on my Salesforce record and integrate the date in another system using the Rest API. I am unable to do this using the PATCH request workaround in apex. Booking__c ...
0
votes
1answer
25 views

Not able to view attachment in salesforce, when uploaded through Multipart Rest API

Below is the code which I'm trying to insert attachment through API not sure what is wrong, when I try to open 'Failed to load pdf' error comes or if I send image type file then that also doesn't open ...
0
votes
1answer
53 views

To retrieve email Id for an email in MC using Rest API [closed]

Please can anyone suggest how to retrieve email Id for an email in MC using Rest API Regards, Shiva
1
vote
0answers
31 views

HELP API Callout error uncommitted work pending for bulk update

I created a batch class that calling an API and then update the records. This batch running every 5 minutes. And there`s a custom button, if I click that custom button, the batch will run only for ...
-1
votes
1answer
73 views

How to parse Json response and insert Record in apex? [duplicate]

I need to read the json response(response will be for one record) from Rest API and need to insert record in salesforce. I tried using below, but unable to get fields. Json response: "Vehicle":[ { ...
0
votes
0answers
15 views

REST Endpoint vs sobjects Endpoint

I want to get my understanding right on API Limits. Currently to update an object from an external application we are hitting the below endpoint. /services/data/v44.0/sobjects/CustomObject__c/...
0
votes
1answer
55 views

Future methods do not support parameter type of Map<Id,SObject>

I am calling a method from a trigger that makes an external rest api post call. I am creating my json like this and trying to use the setBody() method, but getting an error and I am not sure how to ...
0
votes
1answer
92 views

how to get more than 2000 records rest api

I am trying to get more than 2,000 records from salesforce using Rest Api. /services/data/v47.0/queryAll/?q=Select+Id,XXXX__c,CompletedDateTime,XXX__c+from+task+WHERE+CreatedDate+>+2019-10-20T00:...
5
votes
1answer
276 views

Authorize Apex Rest API call using an Azure token

I'm new to the OAuth concept in Salesforce and looking for some pointers for my use-case. I'm not even sure if I'm framing my question correctly, but I'm trying to understand if I can invoke an Apex ...
0
votes
1answer
35 views

Is it possible to execute with different URL from endpoint of custom activity?

Is it possible to call execute URL from different endpoints? For example, I set the installed app and set custom activity with the endpoint as https://some-endpoint.com/ for the message. For your ...
0
votes
1answer
80 views

What is the correct format in mulesoft to update a date datatype field in salesforce through upsert API

I have tried the date formats listed in the Salesforce documentation for updating a date datatype field from Mulesoft into Salesforce but they all have been rejected as invalid for datatype. I tried ...
0
votes
1answer
37 views

Using Named Credentials with Password Authentication Protocol

I'm trying to make a callout using named Credentials and my Authentication Protocol is Password Authentication. But I'm getting Unauthorized status. I'm not sure if I'm missing any parameter or ...
0
votes
0answers
30 views

How to authenticate to a salesforce instance and make an API call on submission of a form?

I'm essentially using a basic HTMl, CSS, Javascript form to have my potential customers submit their interest to my site, and I'd like to have the form make a call upon submission to my Salesforce ...
0
votes
0answers
18 views

REST API in new instances not working… existing instances fine

We've got some .NET apps that connect to salesforce REST API through a connected app. We created a new full sandbox from production but the REST API won't connect with the error {"error":"...
0
votes
1answer
88 views

How do I go about adapting / updating this API trigger to work on both record Insert and update? (Currently it only works on record creation)

I'm just getting to grips with Apex and trying to get an API working with Open Weather Map API. Currently, the API Trigger I use only runs on record creation and it works great. But, I would also like ...
0
votes
0answers
54 views

How do I get return value (success or fail) when executing custom activities

I'm currently working custom activities on Journey Builder - however, I had troubles with getting response values after execution is done. [Expected] 1. Journey Activates 2. Execute custom activity 3....
3
votes
1answer
445 views

REST API Callout LWC

I have created an LWC with a REST API call to grab data from and external DB. The data is fetched successfully and then rendered in the component. I would then like to create a record based on the ...
0
votes
1answer
54 views

How do I use REST API on a Trigger to populate account fields

I'm new to working with API's and code in general, I have been challenged to create an API to collect data to input into Salesforce records, this will be invoked by a trigger. Currently, I'm running ...
2
votes
1answer
35 views

REST API GET FIELDS IN ARRAY

Hello guys i want to get Json array in fields, I created 1 php file in a server and this php file to bring JSON data for the Product Informations, And after i wrote 1 apex code in Execute Anonymous ...
0
votes
1answer
54 views

How to send authorization to web app using Rest API [closed]

This is my first time working with API and I'm trying to understand how to send authentication to an web app using REST API. Questions I have: Do I need to setup Oauth in Salesforce in order to ...
0
votes
1answer
40 views

Web 2 lead latitude and longitude values are not inserted

I'm using a Web2Lead form, and on submit pass all input values. But when I try to insert latitude and longitude values, they are not inserted in SF record. I'm try to use different ways, but still no ...
0
votes
0answers
33 views

how to get picklist value in Rest API

I am new in salesforce, I want know how to get the custom picklist value from REST API, I get the all the picklist from below API $this->instance_url//services/data/v38.0/sobjects/Opportunity/...
0
votes
1answer
31 views

Spam filter REST API Data Extension

Does anyone know whether Marketing Cloud uses some spam filter for REST API calls? I am currently implementing an API request on a website form which will upsert rows in a Data Extension in Marketing ...
0
votes
0answers
24 views

Determine if a record update is performed via REST API? [duplicate]

Our use case is to relax validation rules in cases where the update is made from an external system. Each user authenticates individually so unfortunately we cannot look for an API user.
0
votes
1answer
29 views

Retrieve Data Extension based on ObjectID using SOAP API

Using the Marketing Cloud API I'm trying to programmatically determine the fields in an event definition. So... I can start with the ID of the journey and get the journey definition with /...

1 2 3 4 5 52