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
17 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
15 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
38 views

Upsert in @Restresource Apex POST Method

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
32 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
33 views

Salesforce callout using graphql format

I am newbie on salesforce callout with graphql format. Can anyone please guide me how to write http request set body as a graphql json string format. Many thanks.
0
votes
0answers
17 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
1answer
88 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
34 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
24 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
29 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
20 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
7 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
30 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
31 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
30 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
45 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 ...
0
votes
2answers
54 views

Deletes using graph API

I've tried to leverage the new Composite Graph API to delete records for which I only know the external Id. I've tried 2 ways and both of which have failed Method 1: In a single request: a subrequest ...
0
votes
0answers
49 views

Is it possible to use OwnerChangeOptions with the REST Api?

I often change the Account Owner in my salesforce objects using the REST Api. I want to use the OwnerChangeOptions, for example TransferAllOwnedCases. But so far I have only found how to do it using ...
0
votes
1answer
32 views

Is it possible to make a synchronous upsert request for multiple records with Salesforce native Ids instead of external Ids?

I'm currently developing a system which, among other things, will act as a proxy for Salesforce's APIs. We may occasionally want/need to send a collection of new and updated data through the proxy ...
0
votes
1answer
31 views

How do I pass an array in the body of a POST REST API?

An external vendor is requiring to pass an array/list in order to send data from Salesforce Account to their system. They provided me with the code shown under request.setbody, but I am getting an ...
0
votes
0answers
22 views

How to extract a specific URL value from JSON response [duplicate]

I am sending a API request to a third party system called quip and I am trying to extract a particular URL from the JSON response that I am receiving on that call, through apex code. The JSON response ...
1
vote
0answers
86 views

Is it possible to return CORS headers (Access-Control-Allow-Origin) on 401 Unauthorized responses?

I've enabled CORS and am using My Domain to successfully make REST API requests from a browser, after getting an Access Token via the User-Agent flow. My goal is to also use the Refresh Token to ...
0
votes
1answer
78 views

/services/data/v46.0/scheduling giving error: Service not found at: /services/data/v46.0/scheduling

When I try to call the URI: /services/data/v46.0/scheduling from workbench, I am getting the below error: [ { "errorCode" : "NOT_FOUND", "message" : "The ...
-1
votes
1answer
28 views

Salesforce Parse Json to account Object

JSON Sample: { "metaAcc": { "totalRecords": "234", "pageNumber": "1", "pageSize": "200", "lastPage": ...
0
votes
1answer
68 views

Create case with template via REST API

I would like to create a case that asks for data to be filled in via something like an HTML form. My research so far indicates that a Template is the weapon of choice for the "form". I want ...
0
votes
1answer
40 views

smartdatadiscovery​/predictionDefinitions

I am having issues in executing smartdatadiscovery​/predictionDefinitions API via workbench - I am gettging the below exception Service not found at: /services/data/v50.0/smartdatadiscovery​/...
1
vote
1answer
127 views

SFMC Rest api to create/delete Data Extensions

I have been using soap API's to create and delete data extensions. In the marketing cloud documentation, I do see an API to insert rows in data extension, but I can't find a rest API to create a data ...
0
votes
1answer
39 views

How can I call a RestResource through a Community site?

I have a RestResource hosted at /services/apexrest/MyApi. I know that VisualForce pages have an alternative URL through the Community site e.g. /sfsites/c/apex/MyVisualForcePage. Does the same apply ...
0
votes
1answer
66 views

How do I use the REST API to update an Apex Trigger?

curl --location --request PUT 'https://ap17.salesforce.com/services/data/v48.0/sobjects/ApexTrigger/01q2x000000YiNcAAK' \ --header 'Authorization: Bearer 00D2....' \ --header 'Content-Type: ...
0
votes
0answers
14 views

I am new to Salesforce development. I am not sure how to write the Test class for this Rest Service I created [duplicate]

@RestResource(urlMapping='/sdf/lead/*') global with sharing class LEAD_Controller { public class LeadWrapper { public string firstName; public string lastName; public string email; ...
0
votes
0answers
52 views

Session expired or invalid on using access token

I have created a connected app in which I have selected the OAuth Scopes "Access and manage your data (api)" and "Full access (full)" through the consumer key and consumer secret ...
0
votes
1answer
31 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
96 views

Expected JSON object to deserialize apex parameter from at [] [duplicate]

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
104 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
36 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
36 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
57 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
35 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
32 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
60 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
94 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
90 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
27 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
58 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
289 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
82 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
363 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
86 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&...

1
2 3 4 5
16