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
5 views

Using Named Credentials to pass a custom API Key

I'm trying to make use of Salesforce Named Credentials to securely store the API Key and call endpoint accordingly. I tried to pass a custom API Key to an endpoint as below. HttpRequest req = new ...
0
votes
1answer
11 views

SFMC Cloudpages, Content Builder retrievea nd creation using API

With Chrome enforcing the blocking of mixed content and our clients looking into purchasing SAP and or SSL certs depending on their current configuration, Support have advised that cloudpages need to ...
1
vote
1answer
31 views

Expected JSON object to deserialize apex parameter from at []

I develop an Apex REST web service in Salesforce and I would like to test it with Postman. Unfortunately, I get an error message than I don't understand: Expected JSON object to deserialize apex ...
0
votes
1answer
24 views

How can I receive an API Response (Post Request) encoded as a Byte Array

I am posting data to an endpoint and in getting an excel (xlsx) file back. More details: I am required to post a JSON string to an endpoint (this is working fine). In turn, I get back an XLXS file in ...
0
votes
0answers
31 views

Named Credentials and REST Callout for an API that provides me with a token [duplicate]

Writing an Apex class to make REST Callouts to several API endpoints (Jira, Tempo, and Zendesk). Methods on the class will be invoked daily by the Apex Job Scheduler. Jira was easy to setup using ...
0
votes
1answer
30 views

HTTP Post Call from one Salesforce org to another not working

I have two Salesforce orgs connected and I am trying to pass a created Opportunity from one to the other using Apex REST callouts. Everything seems to be connected properly because when I test with a &...
0
votes
0answers
37 views

Create Order REST API endpoint returning 'Entity Not Availble' for OrderItem in Sandbox

I'm using the REST API Create Order endpoint (/services/data/v49.0/commerce/sale/order), but when I try and POST to it in my sandbox I get the following: "[ { "errorCode" : "...
1
vote
1answer
28 views

Connect REST api to add existing file to existing folder — like ContentDocumentLink

I'm (successfully) uploading a file to the /connect/communities/{community}/files/users/me endpoint. I'm able to share that file with a specified user by creating a file share /connect/communities/{...
0
votes
0answers
23 views

How to upsert attachment using Named credential callout to Rest api endpoint?

I am trying insert/update attachment on a record by making use of Named Credential that I have setup on a different org. I am passing the attachment properties (Name, Body, ParentId, Description) from ...
1
vote
1answer
31 views

Idempotency in Creating Multiple Records with REST API

This documentation shows that you need to use the referenceID with each record to do batch creation. Does Salesforce use this referenceID to achieve (per-record) idempotency? Or will it just create a ...
0
votes
1answer
48 views

Rest API to create/update data extract activity is not working

Could someone please point out the mistake in the below script? var restapi_url = "https://XXXXX.rest.marketingcloudapis.com/automation/v1/dataextracts"; var restapi_payload = '{"name&...
0
votes
2answers
47 views

REST API Attach a file to a custom object?

I'm new to Salesforce, I have a form and at the bottom there is a section to upload files that are linked to that form. I have been reading a lot ob how to upload that document using the REST API and ...
0
votes
1answer
26 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
41 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
73 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
59 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 ...
1
vote
1answer
54 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
35 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
41 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 ...
2
votes
1answer
37 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
28 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
43 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
46 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
65 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
76 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
125 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
52 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
69 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
32 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
41 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
27 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
89 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
28 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
60 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
70 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
27 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
939 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
71 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
106 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
46 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
33 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
39 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
70 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
239 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
126 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
604 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 ...

1
2 3 4 5
16