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
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
0answers
31 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) { ...
3
votes
1answer
542 views

REST API: How do you clear a Picklist value?

Using the rest API, I want to be able to clear the value of a Picklist item. For example, I have the Account SObject which has an Industry Picklist. Using the Salesforce website, I can set the value ...
1
vote
1answer
37 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
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 ...
2
votes
1answer
387 views

Create a Report using Salesforce SOAP or REST API

I know about Salesforce Reports and Dashboards REST API. But Report REST API allows only to change (update) an existing report by sending PATCH request with appropriate json body and clone a report ...
1
vote
4answers
11k views

OAuth2 token request failing

My access token request is failing with the following error response in HTTP Response. { error: "invalid_client_id" error_description: "client identifier invalid" } I am trying with the Username-...
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
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
475 views

User and profile for REST API only

I am developing integration in Salesforce with external application. This app uses my api by OAuth password flow. For this I have created user and profile, restricted access to all tabs etc. Are there ...
0
votes
1answer
649 views

Post request returns error 405 on ngrok

I'm using ngrok in order to tunnel localhost and check my REST request from Salesforce. However, when I send POST request I get error 405 - method not allowed. Below there is my code: HttpRequest ...
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
445 views

Marketing Cloud API CORS problem

I would highly appreciate if anyone could help me in handling CORS policy for Salesforce Marketing Cloud API requests… The situation is following: I need to make direct API calls to Marketing Cloud ...
0
votes
1answer
16 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
vote
1answer
2k views

AWS Signature Version 4 IAM authorization

If we want to use AWS Signature Version 4 IAM authorization to add some security controls to some functions in our AWS API, so only a salesforce user can use these particular functions. Do ...
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
1answer
520 views

Having Trouble with Force.com REST API oAuth2 Authentication

I am experimenting with Pat_Patterson's "Interact with the Force.com REST API from PHP". I am using PHP Version 5.6.3 , and I already registered my app via Setup->Create->Apps->Connected Apps. I setup ...
1
vote
1answer
551 views

FATAL_ERROR|System.TypeException: That operation is only allowed from within an active site. Class.System.Site.createPortalUser

This is my code.But am getting an error i.e FATAL_ERROR|System.TypeException: That operation is only allowed from within an active site. Class.System.Site.createPortalUser. Please correct my ...
0
votes
0answers
29 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
26 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
426 views

REST Integration - JSON Serialization/Deserialization alternative to wrapper class

I am building a REST integration between two Salesforce Environments. One environment will be used to setup and stage Data and when ready the Integration will be able to push data from the src to the ...
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
598 views

Getting Attachment Id with subquery using rest api in c#

Hey guys i am trying to get attachment Id in a subquery via the rest api in c# here is my query: SELECT Id, Name, First_Name__c, Middle_Name__c, Last_Name__c, (SELECT Id FROM Attachments WHERE Name = ...
0
votes
1answer
36 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
1answer
717 views

Query Validation Rules associated with an Object using REST API

I need to retrieve all the validation rules associated with a given object, using the REST API. Looking in doc/forums, I've found that I could retrieve validation rules associated with an object ...
1
vote
1answer
711 views

Issue inserting Recordtype for object

I am writing a JAVA-application that mainly functions as a CRUD-platform for my employees. On this application, users can manage data from a specific objects. I am using REST-API. Now, here is my ...
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" } ...
0
votes
1answer
486 views

Can't update existing record with external ID

I have this script that gets time entries from a time tracking tool and that I'm trying to push into a custom object in Salesforce : Time_Entry__c. After following this help page : https://developer....
0
votes
1answer
735 views

display image in json response in Apex

RestResource(Urlmapping='/v1/test/*') global with sharing class DD_Rest_Test{ @HttpGet global static Response getData() { Response resp; RestRequest req = RestContext....
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
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 ...
1
vote
0answers
81 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 ...
3
votes
1answer
957 views

Live Agent REST and CORS

I am trying to create a chat client using the SalesForce Live Agent REST API but I am running into an issue with CORS. Does the REST API support JSONP, if so do you have some examples, if not then ...
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/...
2
votes
1answer
496 views

SOQL over REST: “Truncated”, “Malformed query” depending on which record IDs I ask for

The following query, when run over the REST API, gives me an error: SELECT Id WhatId, WhoId , TaskWhoIds , Subject, ActivityDate, Status, Priority, Owner.Name, ...
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 ...
0
votes
1answer
420 views

Rest Request Callout

I am new in salesforce and I have this rest request to get the access token of the other org so that I can get the installed packages. My problem is, I get an error in sending the authorization ...
0
votes
1answer
397 views

Salesforce REST JSON Nested Self-Related Objects?

ooks like I need some help here. Salesforce documentation and multiple google searches not gave me an answer. Problem description: I'm trying to insert (POST) nested self-related records using REST ...
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
1answer
762 views

Making REST API calls from Salesforce to Marketo [duplicate]

I am new to both making API calls and coding in Apex and feel way over my head. How can I make a call to the Marketo REST API through Salesforce? Is this possible through Apex? For example, ...
1
vote
1answer
772 views

ExactTarget - How to post a record to a data extension that has no primary key?

I have a data extension with the following fields: recordId - number recordKey - text - length: 50 recordValue - text - length: 50 None of the above fields are primary key, because they can occur ...
1
vote
2answers
4k views

ErrorCode 180008 - Unable to queue Triggered Send request. There are no valid subscribers

I'm trying to send an email by ET rest api in Java. I already successfully sent a SMS and got a token in response, but an error is triggered with emails. Here is the JSON I send : { "To": {"...
0
votes
1answer
478 views

Salesforce JSON not passing as UTF8 to external REST API

I'm trying to send a JSON to an external API in UTF-8 but the vendor tells me it's coming through as garbage. I've set the following headers: for(JSONObj.workflowRequestTableFields wfField: wr....
2
votes
1answer
1k views

How do you construct a REST API URI with multiple primary keys?

The documentation for upserting data extension rows by key uses this as an example URI: https://www.exacttargetapis.com/hub/v1/dataevents/key:SomeKey/rows/Email:someone@exacttarget.com. Let's say ...
1
vote
2answers
413 views

Any replacement of chatter API for Download URL e.g. “/services/data/v32.0/chatter/files/06917000000XXXXAAA/content?versionNumber=1”

I want to download the file or ContentDocument using non-chatter REST API. I have explored that we can download any ContentDocument or file by using following kind of chatter REST API (which is ...

1
2 3 4 5
15