Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest-api]

REpresentational State Transfer (REST), or RESTful, web services provide interoperability between computer systems on the Internet. The Salesforce REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

0
votes
1answer
22 views

getting Unexpected parameter encountered during deserialization using REST service

why below REST web service does not properly deserialize the input argument?Please help me out? @RestResource(urlMapping='/HH_Survey/*') global class HH_SurveyController { public ...
0
votes
0answers
10 views

How to retrieve files from an external server

I'm not at all that familiar with web service, but we do have this requirement in which, once a month, we need to retrieve some pdf files from a folder in an external server, and then attach them to ...
1
vote
1answer
19 views

Migration to Content Builder from Classic Content

I mainly use an AMPScript email to create&send emails using Triggered Send. The AMPScript email (script) loads the required information from content html files and values from the Data Extensions ...
2
votes
1answer
20 views

Using queryLocator in the REST API /services/data/v44.0/jobs/ingest

I am doing a report for my Jobs and I need to return a specific Job information using the REST API /services/data/v44.0/jobs/ingest. When I am using the REST API, it is limited to 1000 records. I ...
1
vote
0answers
8 views

Updating Standard Report Type via Rest API on Cases returning error: 'value \“\” is not one of the picklist choices.'

I am looking to update the report type of an existing report via REST API. First I get the report metadata via a GET/describe, then I string-replace just the report type (assuming there is just one ...
0
votes
0answers
14 views

How to create a new report programmatically and set audit fields?

I am looking to create a new report programmatically and set its audit fields (CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate). I followed this REST API Documentation to create a report ...
1
vote
1answer
31 views

Get Method Syntax to move Data Extension from SFMC via Postman

I am new to API Calls, and Postman API Scripts. I have a Data Extension in Sandbox SFMC, which i want to move to Postman via Postman API call. I already have a script to get the access token from ...
1
vote
3answers
29 views

Increase the callout time limit from 120 seconds to more

I am calling a REST API from my Salesforce instance which generally takes 100-150 seconds to process and return the result. The cumulative apex callout time limit is 120 seconds. Is there any way ...
1
vote
1answer
15 views

Dashboard refresh - 403 Forbidden - Documentation of errors

I have a periodic scheduled job that refreshes a dashboard using this HTTP PUT request: /services/data/v44.0/analytics/dashboards/somedashboardId Mostly, this works reliably but every so often I get ...
0
votes
1answer
23 views

Calling SendGrid API from Salesforce Trigger [on hold]

How can I send out bulk emails to our clients from a Salesforce trigger using SendGrid? I have tried sendgrid-apex from https://github.com/sendgrid/sendgrid-apex/issues/12 but that does not seem to ...
0
votes
0answers
10 views

Why Postman isn't showing refresh_token? [closed]

When i'm trying find refresh token then postman isn't showing refresh token. It's showing all things like Token Name , Access Token, Token Type , signature , scope , id_token , instance_url , ...
5
votes
1answer
28 views

sObject describe metadata showing duplicate picklist value entries

I'm doing some code generation based on the standard org sObject metadata. As part of that process I'm using the DescribeSObjectResult.fields.picklistValues PicklistEntry records to determine which ...
0
votes
3answers
33 views

What's the difference between an HTTP Request Message and a Salesforce Rest Resource and the HttpRequest class?

I am new to HTTP and Salesforce's APIs What is the difference between the salesforce rest resource they talk about in this trailhead module - https://trailhead.salesforce.com/content/learn/modules/...
0
votes
0answers
20 views

Accessing salesforce data using JAVA program - facing an issue

This is my JAVA code: package SFtest; import java.io.IOException; import java.net.*; import org.apache.http.client.methods.HttpPost; import org.apache.http.client....
-1
votes
0answers
17 views

Test class for Httpget method [duplicate]

I am struggling to write a test class for below, can some help on this? @RestResource(urlMapping='/CaseAccountid/*') global with sharing class CaseAccountid{ @HttpGet global static List<Case&...
0
votes
1answer
19 views

'Text ' is not a valid value for the enum 'FieldType'

I am trying to create fields dynamically on a custom object. Field's metadata info taking from csv file. When I am uploading the file then I am getting callout exception from MetadataService. ...
0
votes
1answer
15 views

How to associate a contact with an opportunity using Restforce or REST API?

I tried submitting a ContactId with the Opportunity, but received ERROR: INVALID_FIELD: No such column 'ContactId' on sobject of type Opportunity Is there any documentation?
1
vote
1answer
16 views

Unable to authenticate through REST API when using scratch org

I'm having some trouble getting the REST API to work on a scratch org. When I call the login endpoint I get the error "invalid grant". (This happens when I try test.salesforce.com as well as login....
0
votes
1answer
25 views

Customer Community User login using Partner WSDL

Requirement :- Login Customer community user into Salesforce using Partner WSDL. I tried solution provided here and it works for customer community users for me using SOAP UI. But when I used ...
0
votes
1answer
18 views

Error in Json for Rest Api

I have a trigger that sends a certain opportunity to an unspecified stage, so I have a json with the objects, but I intend to send everything in a single string, so I joined json, when I run the code ...
0
votes
1answer
28 views

How to serialize REST Request from Wrapper class for existing Salesforce data?

I am trying to format my SObject data within a wrapper class to POST data to another Salesforce org from a custom Work__c object, but I am having a hard time understanding how to add an instance of "...
0
votes
1answer
29 views

SOQL Lookup failing to retrieve values

I have following query that I am trying to run: select X__Region__r.Name, Operating_Unit__c from X__Worker__c where (X__Worker_Status_Current_WA__c = 'Active') Where X__Region__c is a lookup to ...
0
votes
1answer
43 views

How to create JSON string for REST callout from Wrapper class

I have found a lot of different examples of this, but I'm still having troubles accomplishing this. Here is the webservice which is working: //WORKING Webservice in target org @RestResource(...
2
votes
1answer
29 views

Cannot get salutation field from contact via REST API

I am using force toolkit for .net to get contact fields. I make a soql query like: SELECT Id, FirstName, LastName, Salutation FROM Contact One of my contact has a salutation field set to Mr. like ...
3
votes
1answer
60 views

Using SObject Tree REST resource to update record

I'd like to update an Account and create a child Contact in a single transaction using REST API. Tried to use SObject Tree endpoint, but when I simply pass the Id in object body, I get: Don’t ...
3
votes
1answer
95 views

Get all platform event definitions via REST API

Is it possible to retrieve the list of all platform event definitions using REST API? If I have an event name, I can get its definition using data/v40.0/sobjects/<EventName>/eventSchema but ...
1
vote
1answer
37 views

Bulk API 2.0 works in sandbox but broken in production

I'm trying to bulk import Task records using the Bulk API 2.0, which works perfectly fine in the sandbox, but fails with this error every time when I try to create the job in production: [{"errorCode"...
1
vote
1answer
25 views

How to Query for logged in username [Python:SimpleSalesforce]?

Tried to do user=sf.query("SELECT Id, Name FROM User WHERE Id = :UserInfo.getUserId()" but getting error: content = [{u'errorCode': u'MALFORMED_QUERY', u'message': u'\nSELECT Id, Name from User ...
2
votes
0answers
37 views

Send multiple contacts to API Entry Event in single call [duplicate]

I have not been able to find any documentation on, whether it is possible to send multiple contacts in one payload/call when using interaction/v1/events I have tried sending data as an array, but get ...
0
votes
1answer
38 views

Read Time Out Exception

I am calling REST API method to update some data to another system from apex but getting "common.apex.runtime.impl.ExecutionException: Read timed out" exception. Here is my request code HttpRequest ...
2
votes
1answer
102 views

Using AWS Lambda to query SalesForce

I'm working on a AWS serverless app that will need to query SalesForce from AWS Lambdas to receive it's data and I'm struggling with how to authorize my Lambdas to talk to SalesForce. Most of my ...
0
votes
1answer
18 views

Getting the Salesforce ID in BigInt format

I'm storing the ID of the Salesforce records we have synced with our website. I am currently using an existing table to store the ID mappings for the records. The problem is that the existing field is ...
3
votes
1answer
49 views

Uncommitted Work Pending - Working around DML then WebService

I am working with Salesforce Connect and I am storing my token and expiration times in an encrypted custom setting. My connection is through the client credentials Oauth 2 flow. When a user queries ...
2
votes
3answers
65 views

Calling a rest API from one Org to another Org?

I have created Connected App & Auth Provider. This is the Code i am currently running. Getting error. What I am doing wrong? Can anyone please help me with this? 1st Org - (Class ...
0
votes
0answers
19 views

POST service with Rest API callout method for HTTPS

I have a requirement for POST service. I am using the Rest API callout approach. The end point is in http. The client is asking for using https end point. My question is what is the procedure for ...
0
votes
1answer
22 views

alternative way to traverse through json lists of lists of lists in apex

I have the attached json structure and just wondering is there a better way to traverse through the items to obtain them ? whatever i am doing is working and is shown below , but just would like to ...
0
votes
1answer
22 views

Connected App running user

I've created a connected app for integration usage and I put a specific Sys Admin running user for this - But when data is sent via the Web Service that the integration created - Its still put me (my ...
0
votes
1answer
9 views

Composite Rest Salesforce

Can we use composite(tree or batch) rest to send multiple POST request to third party(non salesforce endpoint) in a single send call ?
1
vote
1answer
27 views

Does anyone know why TimeZonesSidKey field in Organization sObject is not available to be patched by Salesforce REST API?

I am trying to update the Timezone of the organization using the Salesforce REST API as DML operations on Organization is not permitted using apex. However, the TimeZoneSidKey field doesn't seem to be ...
0
votes
0answers
15 views

APEX REST Service permission in profiles and Permission Sets

I have code which makes Rest callouts to an external system for authorization and rest of the working. As per our design team APEX REST Service permission should be disabled. I tested out this is ...
0
votes
1answer
20 views

Salesforce Standard API - Composite Tree resource

In order to create record in bulk using REST API, we using Composite Tree resource. I'm trying to upload a bulk of content versions : {"records" :[ { "attributes" : {"type" : "ContentVersion", "...
0
votes
0answers
35 views

How can I alias a column in SOQL for an object that doesn't support field aggregates?

We want to alias the count() value in a SOQL query for FeedItem however it seems that column naming can only be done when a field is present in count(). Select count() from FeedItem works fine, but ...
0
votes
0answers
22 views

How can Customer community user login into Salesforce using REST API?

I have created one Rest webservice in SFDC (which I want to expose to other users) and set up one CUSTOMER community User. Login URL: https://test.salesforce.com/services/oauth2/token?grant_type=...
-1
votes
0answers
14 views

Not able to access Custom object passing in SOSL in REST API call

Hope you are doing well. I am facing an issue while making API call to one saleforce org from other salesforce org. I have created Auth. Provider and Named Credentials in one org and Connected app in ...
4
votes
1answer
598 views

REST API vs SOAP API?

One of the differences between REST and SOAP is that REST is lighter than SOAP. What does it mean when they say REST APIs are lighter than SOAP APIs? How is JSON lighter than XML?
0
votes
2answers
26 views

API to Create and Delete a Relationship Object

In our sandbox, we have created Student, Role, and StudentRoleRelationship objects. Currently, we have a Drupal project that has its own Student and Role objects, therefore in Student and Role we have ...
1
vote
1answer
31 views

API Integration - Professional Edition

We are currently integrating with a payment provider wherein we send some request and get some response. The payment provider then does a callback and posts the status after some time for the ...
1
vote
2answers
64 views

Limits API callout in Apex

I want to receive daily limit from apex. There is my code public static HttpResponse getLimits() { HttpRequest req = new HttpRequest(); Http http = new Http(); req.setMethod('GET'); ...
1
vote
2answers
35 views

SOAP and REST API

What is the difference between SOAP and REST APIs. Can someone please explain with the scenarios which one I need to pick for which type of scenarios?
1
vote
1answer
22 views

How to use REST API (or preferably Restforce) to upsert and only update when field is blank?

I want to upsert Leads with the following rules: Match by Email If match is found, only update fields that are blank. Is it possible to do this by using API upsert? Is it possible to do it with ...