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
1
vote
1answer
614 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
526 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 ...
0
votes
1answer
525 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
437 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 ...
1
vote
1answer
728 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
770 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
421 views

Message sent through Marketing Cloud isn't delivered and doesn't show up on the deliveries endpoint, what can it be?

I'm making a call to Marketing Cloud's endpoint to send SMS messages like this: -- request to /sms/v1/messageContact/{messageId}/send { "mobileNumbers": [ "55009999999999" ], "...
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
30 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
36 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" : "...
0
votes
2answers
134 views

How to Retrieve large data from Salesforce using Rest API?

I have one new requirement where My client wants to retrieve large data set (~80K records) from Salesforce daily. I have created rest web service but it returns only 2k records. for 80k records, do ...
3
votes
1answer
995 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
568 views

How to change developerName of Dashboard and Report using an existing Salesforce SOAP or REST API?

I tried to save dashboard and report via Salesforce Reports and Dashboards REST API and it works, but when I change developerName in the request body and send this request, in the response I got a ...
0
votes
1answer
462 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 ...
2
votes
1answer
517 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
1answer
27 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 ...
0
votes
1answer
556 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....
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 ...
1
vote
0answers
2k views

SalesForce REST API authentication for Java Client

I am trying to authenticate my java client as explained in this link: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/code_sample_auth_oauth.htm I have created th ...
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
1answer
784 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 ...
0
votes
1answer
47 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&...
1
vote
2answers
422 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 ...
0
votes
1answer
671 views

Generate JWToken from salesforce using Consumer Secret

I am trying to connect to an API and based on their requirement, JWToken is required to make a call and the JWToken must be signed using the provided consumer secret. Now, they have a sample code in ...
0
votes
1answer
922 views

Uploading multiple files using REST API of Chatter.

I am trying to upload multiple files using Chatter REST API. I was previously able to upload a file. Now I have to upload multiple files. I got these file names and parameter names in array, as stated ...
0
votes
2answers
46 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 ...
3
votes
1answer
586 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
56 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
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
71 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
422 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 ...
2
votes
4answers
12k 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
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 ...
1
vote
1answer
484 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
718 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 ...
1
vote
1answer
52 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
575 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
34 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 ...
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
42 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
529 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
632 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
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
45 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
2 3 4 5
16