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

sObject Collections - Update Multiple Records via REST using PATCH - Bad Request 400

I am trying to use the Salesforce sObject Collections REST API resource that was released in Spring '18. Per the Salesforce Documentation, this should be a PATCH request, however when I try to call ...
0
votes
0answers
556 views

Displaying REST response on the VF page on button click

Overview: I am making call to Pardto to fetch prospects and display them into Salesforce VF page on button click. I am getting response fine from pardot but it is not displaying on the vf page. Not ...
0
votes
1answer
230 views

How to store rest response data into Salesforce custom object as records

I have created REST service which is fetching prospect data from pardot and now I want to store it into Salesforce's custom object. I have some fields inthis object which I need to map from the ...
3
votes
0answers
118 views

Unsubscribe MobilePush Contacts with Automation

I need to unsubscribe multiple Contacts from Push Messages with the help of external attributes. It is to be done within an Automation. The only way I see I can do this is the following: Get ...
0
votes
0answers
637 views

AMQP protocol from Apex - RabbitMQ

I am trying to connect and send data to RAbbit MQ messaging protocol. At all places it is provided that we should use AMQP protocol and this is something I am not sure how to do from Apex. Has anyone ...
2
votes
0answers
50 views

Cannot insert Contact with REST API if a Lead with the same e-mail address exists

I noticed in the UI that when I try to insert a contact with an e-mail address that a lead already has, I get a warning (before I click save and insert the contact) saying that this is a possible ...
1
vote
1answer
239 views

Retrieving all calls, posts, comments etc for a Case

We have the following scenario in an application built with React and implementing the REST Api via an integration user. We currently: Retrieve a list of cases based on a custom Master ID field ...
0
votes
1answer
1k views

Create leads in Salesforce through REST API. How to assign assignmentruleHeader and emailHeader?

I am trying to add leads in salesforce through rest API.Code is in java. I have converted WSDL to jar files and added as reference in Eclipse which allow to access salesforce objects in java. PFB my ...
0
votes
2answers
355 views

Unable to convert phone to string in apex

I am working on rest API services. I need to push phone number as a string in the body of the request. I tried following way. String Str1=ts.phone.replaceAll('(',''); String Str2=Str1.replaceAll(')',...
0
votes
1answer
716 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
445 views

Invalid conversion from runtime type String to Map<String,ANY> not working

I have a requirement to call a external service with post method. When i tested in anymonous block.It's working fine. But when i try to set up test classes i got this error. in line Map results ...
2
votes
1answer
82 views

Why am I not able to parse valid XML straight from the Salesforce Documentation, but JSON works fine?

On this particular page: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm About halfway down, you'll see a method which I have included in my class @...
0
votes
1answer
1k views

Status Returned 200 but response body is blank

I'm new to integration. I am going to generate an access token for the third-party application. I tried to build following javascript request in sfdc. But the response body is blank. I need to ...
1
vote
1answer
531 views

REST Upload attachments - Json Deserialization failed on token 'null'

I'm using simple-salesforce to migrate attachments from one org to another. I'm encoding with base64 but am getting this error: SalesforceMalformedRequest: Malformed request https://my_org.my....
0
votes
1answer
2k views

How to Generate Access token in rest api with apex [closed]

I'm new to integration. I want to post a field value to other external application. So, the third party is using OAuth 2.0 Security. I'm going to generate access token through client key. They ...
2
votes
3answers
1k views

Getting JSON_PARSER_ERROR while parsing JSON

What am i doing wrong due to which i am getting JSON_PARSER_ERROR, I am using code below to parse json below : @RestResource(urlMapping='/Imbellus/CandidateScore') global with sharing class ...
4
votes
1answer
1k views

How to use upsert in REST callout JSON

"Upsert" just inserts new records from JSON, but not updates existing. It's my code: public class myClass { @future (callout = true) public static void getCallout(){ Http http = new Http(); ...
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
0answers
425 views

REST API - Issue connecting JS app when CORS and Remote Site are both setup properly

I cannot connect to Salesforce to automatically create accounts from my javascript app. I continue to get the error: "Failed to load https://login.salesforce.com/services/oauth2/token: No 'Access-...
0
votes
0answers
179 views

Soql does not return record Id in main class. But returns in Test class

Hope you all are doing well. I have a issue when writing test class. I have created a method where I am inserting a objectA record. Once the ObjectA record is inserted, objectB record get ...
1
vote
1answer
156 views

How do i check if a user logged into salesforce from javascript? Either through api or reading cookie value [closed]

We want to allow users who are already logged into salesforce and have access to our application to continue to our application home page without going through the login flow , if not we want to take ...
0
votes
0answers
103 views

REST API Call to OKTA with filter fail

I'm building an integration with OKTA using APEX. One of the actions I need to call is: get all the users which has updated in the past hour. I'm executing the following code and get an error: 400 ...
2
votes
2answers
274 views

OAuth flow for using my app as the authenticator

I'm using SF Restful API to develop an app. A generic use case of the app would be: User logs into the app (app specific credentials) User requests data available @ SF. App knows that user is allowed ...
1
vote
1answer
80 views

RestResource Class with sharing keyword

I am having rest resource class on site in which I am querying contacts and leads. I am able to query contact records when class is without sharing but not able to query contact records when class ...
1
vote
1answer
852 views

BULK API V43 Pass Date/Time Value

I am trying to make a PUT call via fiddler passing in Content-Type: text/csv. I am able to pass in all fields, however it fails on one of the fields that requires a date/time value. I am passing in ...
1
vote
1answer
38 views

Is there a rest api that check the api calls limit without consuming an api call?

I wanted to check my daily api requests, with /services/data/v37.0/limits/. It consumes an API call. How do I check one without consuming an API call?
3
votes
0answers
1k views

Is there a way to create an OpenAPI / Swagger spec for my Salesforce Account?

I've been using the Saleforce REST API for a while and I'm interested in using an OpenAPI / Swagger spec to auto-generate a SDK using OpenAPI Generator and Swagger Codegen. Is there a way to get an ...
1
vote
2answers
3k views

Retrieving csv document using HTTPRequest

I'm working on a project to retrieve/GET a csv file using an HTTPRequest update the associated Salesforce records, and POST a csv back I found this 'send a report as a CSV/TEXT' thread, which looks ...
1
vote
1answer
1k views

Retrieve a list of all JobID done in Marketing cloud

I want to know if you can retrieve the list of all jobID via a REST or API call, I found nothing in the official doc so does anyone have a trick to get this list? There should be a way, because if you ...
0
votes
0answers
101 views

How to consume OAuth 1.0 webservice in salesforce

I have another application which I need to call and they are using OAuth 1.0. now I am calling their system endpoint, I have client id and client secret only. Do I need to generate token also? ...
1
vote
0answers
168 views

Retrieve the list of tracking on a Data Extension via REST

I'm trying to make an API call to, if possible, have the JobID of all sends done on this Data Extension. Is there a way to get the list of tracking on a data extension via REST API ? When you are on ...
1
vote
2answers
80 views

Are DataSource.Connection / DataSource.Provider the way to go to create an OAUTH connection to a 3rd party?

I've played with JSON.serialize() & .deserialize() to pack & unpack data that I will be sending to a 3rd party (PureCloud). We have an existing integration with Twilio to send & receive ...
0
votes
1answer
84 views

null result in bulk api 2

I followed the insert walkthrough in the bulk api 2 docs. But when I checked the results I got 0 records processed and an unhelpful status of null:InternalServerError : null I toyed with the ...
6
votes
1answer
79 views

Strip Authorisation header from inbound REST Request

I'm integrating with a 3rd party data provider. The way their platform works is you must provide an endpoint to which they periodically send REST requests to with updated data etc. They happen to ...
0
votes
1answer
931 views

How do I retrieve Country and State Picklist Values (AddressSettings) via API?

How do I get a dependent list of States by Country from Salesforce via API? Our Use Case is: We need dependent Picklists on an integrated 3rd party web platform we intend to pass the returned ...
7
votes
1answer
707 views

How do I enable REST Metadata API?

I am getting this error in Workbench when using the REST explorer: API_DISABLED_FOR_ORG message: The REST Metadata API is not enabled for this Organization. errorCode: API_DISABLED_FOR_ORG INFO: We ...
1
vote
3answers
3k views

Error : JSON request body must be an object

I have a Post method where the other system will be sending me the JSON like this [{ "query": "SELECT AccountId,Birthdate,FirstName FROM Contact WHERE(((FirstName = 'Vikram3' AND AssistantName = '...
1
vote
1answer
732 views

Journey Builder(Custom Activity): InteractionStudio RestActivity failed validation for Save

I came to you guys because I don't understand a problem on a Custom Activity in Journey Builder, here is the error : I am a beginner so sorry if it is a stupid question. I thought it was that my ...
3
votes
3answers
5k views

Generate new password and notify user immediately

While creating new users from Salesforce UI, we have a checkbox right at the bottom called Generate new password and notify user immediately. This is set to true by default and sends Welcome To ...
1
vote
1answer
781 views

How to use 'q' parameter for google drive api

I want to pass q parameter in setEndPoint url to get list of all files in the root folder(at the home page). I tried it using the google API(https://developers.google.com/drive/api/v3/reference/files/...
7
votes
4answers
2k views

Lightning: Getting a 401 when calling @AuraEnabled Apex method to do a REST call

Trying to write an Apex method that accesses Chatter REST api using this technique: https://chintanblog.blogspot.com/2017/02/call-salesforce-rest-api-from-apex.html This method is @AuraEnabled - so ...
1
vote
0answers
123 views

How to use SObject Describe resource and the If-Modified-Since HTTP Header in workbench

I'm trying to use If-Modified-Since in workbench, based on the example available in Rest API developer guide. But I'm not able to see the desired response. Here is what I tried so far: Please let me ...
1
vote
2answers
818 views

updating json response salesforce

{ “FirstName” : “Foo”, “LastName” : “Bar”, “Address” : { “city” : “Pune”, “state” : “Maharashtra”, “country” : “India” } } My issues is to fetch the "city" value from the above json ...
1
vote
1answer
3k views

URL_NOT_RESET error REST API

I have created the REST Resource to fetch the data from Salesforce. My Domain is also activated in our Org. When I fetch the data using https://myDomain.my.salesforce.com/.../... it is returning me ...
-2
votes
1answer
416 views

Problem in converting null or empty string to decimal

I've implemented a REST HTTP method for lead creation. There is a Number field XYZ(16,2) field. When I tried to insert with a null value it is giving an error like invalid decimal. Please help me. ...
1
vote
2answers
693 views

Salesforce Marketing Cloud REST vs SOAP API

This quetion is related to marketing cloud APIs. I need to perform below tasks on marketing cloud via API. Create a Data Extension Create a Query activity Run query activity Retrieve data from Data ...
6
votes
1answer
418 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" ], "...
1
vote
1answer
347 views

Return Custom Response via Marketing cloud API

I wish to expose a custom service API (Soap/Rest) from marketing cloud so that when an external entity invokes the same, I can have some logic to process the data from the request and then return the ...
3
votes
2answers
2k views

How to Query ApexLog raw body?

I need to find, in ApexLogs raw bodies, references to a given String value. I know we can query the object ApexLog fields, by using the following code: SELECT id, loguserid, ...
0
votes
1answer
524 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....

1
3 4
5
6 7
16