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
0answers
32 views

How to open pdf in a new browser tab? [closed]

I have a REST API call which takes a Website URL as the body and returns the pdf format of that site. Here is the code: @AuraEnabled public static String convertLinkToPdf(String websiteUrl) { ...
0
votes
1answer
23 views

Mismatch in custom object field count in rest api and salesforce UI

I have a java codebase for performing CRUD on salesforce as an rdbms db. I was looking at the response on my rest api and that on SF setup UI of a custom object that I create in object manager. I have ...
0
votes
2answers
36 views

APEX Callout return type not always known, unsure how to adapt to different situations

I have an APEX callout that makes a call to a REST API and returns an object, in this case I am calling /services/data/v48.0/sobjects/Case/describe. I was trying to use this same APEX class to call ...
1
vote
1answer
45 views

Callout to other Salesforce org using Named Credential - which Authentication option should I use?

I have 2 Salesforce orgs (with identical code) - a hub and a client. I need to pass data from the hub to the client. Using S2S is fine for normal data, but when it comes to files (eg pdf) we can't use ...
1
vote
1answer
39 views

REST request for creating a new DataCategoryGroup or DataCategory

I can't find any documentation on creating a new DataCategoryGroup or DataCategory object from the REST API. I can read them, and link them to knowledge articles, but I can't see to find anything ...
0
votes
0answers
14 views

Account name to ID mapping

I am preparing a demonstration of how an RPA platform can insert orders into SFDC based on data extracted from inbound PO documents. I am able to insert an order based on the details I found at the ...
0
votes
1answer
32 views

Salesforce REQUIRED_FIELD_MISSING, Required fields are missing: [Company_Make__c

I am getting this error below when i tried testing my apex rest services using work bench System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required ...
0
votes
1answer
17 views

Using C#, how can I get a jobId for Bulk Api 2.0?

I am trying to set data from an Azure Service Bus to an instance of Salesforce using the Bulk API 2.0 and and REST (because who really wants to deal with SOAP?). I am currently struggling "simply&...
0
votes
2answers
36 views

Rest API Test Class Problem

I am having some problem while testing my rest API Class. My main class is as mentioned there @RestResource(urlMapping='/ONB2__Subscription__c/*') global with sharing class SubsRecord { @HttpGet ...
1
vote
1answer
34 views

Help with Rest Resource

I'm working with integrations rn, and I'm stuck... I need to create a public site to receive calls fired by a third-party system. I'm using this tutorial: http://www.wadewegner.com/2013/03/creating-...
0
votes
1answer
27 views

How to renew expired salesforce token for making REST queries

Last night I fetched some data using the below GET request const result = await axios({ method: 'get', url: `https://tahina-test2-dev-ed.my.salesforce.com/services/data/v48.0/...
0
votes
1answer
32 views

How to write Get query to get the correct Pricebookentry objects

Im rather new to SG and is trying to fetch some data. What I want to do in a nutshell is fetch all the Pricebookentry that match a certain Pricebook2Id. I tried the below query for this on the ...
0
votes
0answers
30 views

Can AuraEnabled methods be consumed by Off-Platfrom (e.g. Vue or Blazor) frontends? [duplicate]

Let's say, hypothetically speaking, I already have an Apex class which provides a backend for either an Aura or LWC component. Now, for some reason, I have an application which is hosted off ...
0
votes
1answer
27 views

How to get the label/value of a picklist rather than the api name in REST API?

I am new to salesforce. I am trying to get the chosen value of a picklist in an object. The name of the object is product__c. When I pass the product__c in the rest api call, it returns me the api ...
1
vote
1answer
35 views

How can I know why a triggered send has been queued?

I'm sending triggered sends via REST API call but some emails get queued. How can I know what is making them be queued? How can I see the logs without opening a support ticket? Is there any way of ...
0
votes
1answer
37 views

Apex rest service issue with HTTP Post method when i Access from Postman

i created Apex rest service and @HttpPost method , i am able call POST method & got data in request body successfully from workbench. but i had issue with when i try to access from Post man. i ...
1
vote
2answers
115 views

Handle unknown properties with typed JSON.deserialize()

I am looking for an elegant and unhacky way to handle deserialization of a JSON into an Apex type where some of the properties are known and some are not. Assumption: At least for now the unknown ...
1
vote
1answer
42 views

How to determine when someone has been removed from a campaign (REST API)

Similar to this question, I'd like to be able to fire off a query (from an external application) to determine when someone is removed from a Salesforce Campaign. The question I linked has a good ...
6
votes
1answer
68 views

Metadata API: any drawback when using REST instead of SOAP?

Is there any drawback on using Metadata API through REST (that became available since Winter'19)? I only see good things such as: Smaller payloads: probably improving performance reducing the network ...
1
vote
2answers
29 views

What is the best way to determine when a campaign has had a new contact added to it?

If I want to use Salesforce's REST API to return campaigns who have recently had members added to them, what is the easiest way to do so? I am trying to do this externally, using authentication ...
1
vote
1answer
40 views

Querying Salesforce Campaigns for Newly Added Contacts

I'd like to pull all of the contacts who have recently been added to a campaign using HTTP requests (from an external application). My current method is using a GET request with the URL /sobjects/...
0
votes
1answer
21 views

How to get a value from a REST Callout from a Trigger

hope you are all well. I have do have one question : I need to create a custom object that collects data from an external web service. According to a picklist value from this object, I need to set a ...
0
votes
1answer
52 views

Getting error, “You have uncommitted work pending” after invoking rest method via Process builder

I found many resources available on stackexchange regarding this issue. We cannot make a callout after doing any dml. But i do not think i am doing any DML operation in my code. Logical flow of my ...
0
votes
0answers
27 views

REST Mutual Authentication Certificate [duplicate]

I need to setup my rest endpoint to authenticate using Digital Certificates. When doing research about mutual authentication the examples are only using soap. https://help.salesforce.com/articleView?...
0
votes
0answers
41 views

error on trying to insert Opportunity Contact Role

I'm getting this error when trying to create an Opportunity Contact Role via the REST API: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: entity type cannot be inserted: Opportunity Contact Role I suspect ...
0
votes
1answer
61 views

Salesforce Einstein get dataflowjob status REST API

I was able to call a dataflow through REST API with the following: Request: /services/data/v48.0/wave/dataflowjobs Request Body: { "dataflowId": "02K2w0000009xxxxx", "command" : "start" } ...
2
votes
1answer
25 views

API Rest Salesforce :Describe layouts does not return all layouts

I just created a new org, so there are different layout on the Account object: Account Layout Account (Marketing) Layout Account (Sales) Layout Account (Support) Layout But when I retrieve the ...
1
vote
1answer
32 views

Sharing rules not respected for related queries

I have set my Account to Private. I have Activity (Task) set to Private I have two users - Joe Schmoe and Karen Hoyts. I have created an account Joe's Account. Under that account, i create a task ...
0
votes
1answer
264 views

System.JSONException: Unexpected character ('a' (code 97)): was expecting double-quote to start field name at [line:1, column:3]

I´m trying to complete a trailhead challenge but when I test the method, it appears the error System.JSONException: Unexpected character ('a' (code 97)): was expecting double-quote to start field ...
0
votes
0answers
49 views

How to Convert Candidate Patient record into Salesforce Account in health Cloud?

I'm creating patient records through apex REST api in Salesforce Health Cloud.Actually Patient records have Account lookup field.How can I convert newly created candidate patient record into Patient ...
1
vote
0answers
82 views

How to upload a Salesforce File using REST API properly?

GET /services/data/v47.0/sobjects/ContentVersion/0000v00000MFIVgAAP/VersionData from this request I will get binary file content, but how can I use this content to recreate the file properly (using ...
0
votes
0answers
39 views

Rest api not returning notes via get service in workbench

I am using workbench get service to get enhanced notes child records for a given account. Even though enhanced note data is present for that record, I am not getting any data back from the service ...
-1
votes
1answer
31 views

Rest API response to deserialise in to map to compare the data with other object.Value is not comparing and hence campaign data is not updating [closed]

http request : My intention here to compare the resopnse data with campaign object data and then update the campaign Http http = new Http(); HttpRequest httpReq = new HttpRequest(); ...
0
votes
1answer
36 views

Can't create assets outside parent folder via Fuel SDK

I'm trying to create assets using the Marketing Cloud PHP Fuel SDK, and I'm running into a problem where the assets are being created (as in, I can retrieve a list of assets and see the assets I've ...
0
votes
0answers
19 views

I cant able to get more code coverage cant able to parse json deserilalize code [duplicate]

I am inserting multiple invoice and invoice items at using post web service REST API Bulkinsert_InvoiceInvoiceitems class @RestResource(urlMapping='/InsertInvoiceandInvoiceitems/*') global ...
0
votes
1answer
51 views

REST Api Contracts and Documentation

I'm integrating with an external system, they will be able to send a POST request through REST API and create records of a custom object I've created in my org. I need to send to the client the ...
1
vote
1answer
157 views

Using curl to make a REST API call

I need to call a rest API service in Saleforce from an external client. This application logins in Salesforce with the SOAP standard login service and then has to call some custom services. The ...
0
votes
1answer
103 views

Internal Server Error When POST to Marketing Cloud create contact REST API

I am getting an internal server error when trying to save a contact in Marketing Cloud with Rest API. The body of my request is: { "contactKey": "acruz@example.com", "attributeSets": [ ...
-1
votes
2answers
289 views

Empty request body when when using curl

I have a rest service in salesforce which it has to receive different requests. When I test the service sending requests, if I use a REST Client I am able to get the requestbody properly but if I use ...
0
votes
0answers
181 views

Setting up Named Credential for External Rest API with OAuth2.0

I am trying to understand how to set up the Named Credentials & OAuth Provider in Salesforce for calling the External REST API. Before setting this up I tested the call to the REST API through ...
1
vote
0answers
76 views

REST services getting empty result for User object

We set up a REST service to retrieve data from our org. Everything works great, except for the queries to the User object. When the query returns we get an empty list. This used to work (it was ...
0
votes
0answers
17 views

Converting a cURL to Apex Request [duplicate]

curl -X POST https://api.voilanorbert.com/2018-01-08/search/name \ -u any_string:{secure_token} \ -d domain="example.com" \ -d name="Fake User" I am strugging to convert the following into an Apex ...
1
vote
1answer
29 views

Getting LastModifiedDate of a Component File?

There is a post from 2019 here that details obtaining a couple of fields about a Lightning Web Component. Is there a way to get that information programmatically? Could not tell if trying various ...
0
votes
0answers
21 views

How to render content on mobile app through salesforce rest api when the service is sending string value consisting of <div> tags

discriptionvalue += '<div style="font-size:18px !important;font-weight:bold !important;">'+ s.Title__c + '</div>' ; Note: Need to render the discriptionvalue in my app with the style ...
1
vote
1answer
78 views

Calling out via Named Credential - API vs Token endpoint

I created Named Credentials to authorize the api and got the token. Now i want to use the same end point to get the weatherdetail. when i tried to access same named credential then its showing error ...
0
votes
1answer
34 views

Parsing nested object

I am trying to parse the 'events' and 'consumer' details from this payload using Apex but am getting stuck getting to the eventData. Could explain how I would correctly retrieve those objects? ...
-1
votes
2answers
129 views

how to create and send the request/response body for the post method in test class [duplicate]

static testMethod void testPost(){ RestRequest req = new RestRequest(); RestResponse res = new RestResponse(); Profile testEditorProfile = [Select id from Profile where Name= :System....
0
votes
1answer
74 views

Problem with Rest Webservice Code coverage [duplicate]

I have the following set of lines in my code RestRequest req = RestContext.request; RestResponse res = RestContext.response; AreaRequestWrapper areaRequestRecord = (AreaRequestWrapper)...
1
vote
1answer
121 views

URL doesn't exist in REST api call

I'm trying to subscribing platform event channel through REST. I have executed below code I'm getting the error called "URL doesn't exist". Is there any changes needed in the url format. Please ...
1
vote
1answer
85 views

Getting content using force.com sites in salesforce

I have a requirement where i have to download archived content from external system. However, salesforce does not allow to get archived content from REST API. The way i can download the archived ...

1
2 3 4 5
15