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]

The REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

1
vote
1answer
18 views

PATCH Service with Only Changed Data

I'm trying to come up with a solution to build a PATCH service where the external service will only be patching data that has change in their external system, we want to do this to to limit the ...
0
votes
0answers
135 views

How to Enable API (API_DISABLED_FOR_ORG)?

Im trying to integrate my php application with salesforce using the rest api via auth2. The queries im making on the account : $access_token = $_SESSION['access_token']; $query = "SELECT Account....
1
vote
1answer
331 views

How to trigger email when creating a case via REST API?

When it comes to the SOAP Api, it exposes among its headers EmailHeader which can be used to trigger email sent when a case is created via API. By default, when a case is created via API, the case ...
0
votes
1answer
161 views

Amazon S3 Integration

I am trying to upload a JSON file to amazon s3 bucket. But I am getting an exception as : Callout Exception: Unexpected end of file from server My Code : public class ProductAmazon_RestClass { ...
1
vote
1answer
826 views

Create PDF from the created record and save it as attachment

Good day everyone. I am trying to create a pdf from a newly created record. I search in the internet and I find this link : https://jungleeforce.wordpress.com/2014/06/11/generate-a-pdf-and-attach-it-...
1
vote
2answers
56 views

Existing Test Class - Getting 500 error

Why would I get an 500 error on this test class? I am troubleshooting someone else's test class and am only getting five out of nine methods passing with all four failing methods failing on the ...
0
votes
0answers
732 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 ...
0
votes
1answer
37 views

Is it possible to get list of all files REST API Chatter?

Does anybody know if it's possible to get list of all files in REST API Chatter? There are examples but they are limited to owner only https://developer.salesforce.com/docs/atlas.en-us.chatterapi....
0
votes
1answer
130 views

Issue with Connected-App. Java-Salesforce Rest API

I am getting an issue from my local java application running at http://localhost:8080. When I enter this address inthe browser, I am being redirected to a login.salesforce.com, but I see a blank ...
1
vote
2answers
131 views

Apex Rest Web Service Error - List index out of bounds

All, I have seen this problem documented numerous times but have yet to find a fix that will address my situation. I am trying to either update an existing case or create a new on based on SOQL look ...
3
votes
2answers
69 views

@future callout from trigger doesn't seem to send data

I've got stuck with a simple problem. When an Opportunity is updated to "Closed" and "Won" I want to send some data to another system. So far I have: update trigger class handling HttpRequest and ...
0
votes
2answers
293 views

POST/PATCH requests are being blocked by Salesforce Rest API

I'm trying to update contacts via REST API with forcejs and simple CURL. I'm trying to POST or PATCH a record, but all my requests have no responses. I'm trying those requests on my sandbox. For ...
0
votes
1answer
25 views

how to use req.params.put in test code for testing htttpGet

i have wrapper class like below public class wrapper_class { public class requestWrapper { string userName; string LastName, string Phone; public (Map params) {...
0
votes
1answer
301 views

How to write a test class for http Get/Post/Patch/Put

We are using outside wrapper class to store requested parameters and passing req.params into that wrapper class. Then we are using those wraper class parameters in httpGet/httpPost etc. How to include ...
-1
votes
1answer
512 views

how to write a Dynamic SOQL query using condition operator '?' [closed]

client requesting data with some parameters like startdate, enddate, status. based on those parameters i have to return results in httpGet method. 1.if status!=null it will add status =:object.status ...
1
vote
1answer
347 views

Rest call with same salesforce org - [Status=Unauthorized, StatusCode=401]

Can some one please guide me where I am going wrong. For some reason i have to invoke the same instance. But i am getting [Status=Unauthorized, StatusCode=401] Error when I Debug. public class ...
1
vote
2answers
72 views

How to create a Case with conditional case ownerId

In apex rest, when the client wanted to create a Case record in salesforce ... if the user already existed it will create case with OwnerId = requested UserId other wise it will create a case and ...
3
votes
1answer
64 views

How to consume a salesforce REST service?

I want to integrate two salesforce orgs using username-password flow. First I got access token, after that I'm trying to call another service which is located in the org. I'm getting following error. ...
0
votes
1answer
138 views

URL No Longer Exists

I'm getting "URL No Longer Exists" when I tried to get access_token through vf page by calling method from it. When I executed this method from anonymous block i'm getting valid response. Any one ...
2
votes
1answer
175 views

Rest API Logging 400 JSON Error

I created an API that has error handling inside of it. However if the payload does not match what the API is expecting, the code inside the API does not execute. Thus it does not log an error to ...
-1
votes
1answer
67 views

values are not receiving dynamically in REST API

I wrote the batch and pass the values to REST apex class but when executing the endpoint url it doesn't take the values of fields it only takes names. this is my batch job global class ...
2
votes
1answer
2k views

Rest Api: “HTTP Method 'PUT' not allowed. Allowed are HEAD,GET,PATCH,DELETE”

I am trying to update a contact record using rest api but facing issue like POST method is not allowed. If I use PUT method. it is also not allowed I have tried this solution How can I make a ...
0
votes
0answers
251 views

How to enable authorization for a public Rest service created in Apex

I'm having a Rest service created by following the Apex REST Basic Code Sample tutorial in my sandbox. My service could be accessed by anybody. I want to limit this by using the OAuth 2 approach. I ...
1
vote
1answer
150 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 ...
1
vote
0answers
124 views

SFMC Custom Activity - Save, Publish, Validate, and Execute not firing

I'm currently having some issues getting the Publish, Save, Validate, and Execute event to come back to my Custom Activity. I've tried looking at a few different answers for similar issues, but they ...
5
votes
1answer
105 views

JSON parsing with same attribute name

I am trying to parse the JSON Response from a Composite REST API call into a wrapper class. However, from the docs, "body" attribute in the response from a Composite Subrequest will be an Object in ...
1
vote
1answer
1k views

RestResource Annotation - What is the urlMapping To?

I have never worked with Rest Resource classes before and am trying to debug one from a previous developer. I am looking at: @RestResource(urlMapping='/CompanyData/*') and am unsure what CompanyData ...
1
vote
2answers
384 views

REST to create multiple objects-JSON Deserializaton failed on token null

I have been trying to create CurrencyType records from APEX and since that doesn't support DML, have been using the REST endpoint and POST method. Everything work fine with single record but with ...
-4
votes
1answer
30 views

Callout Unit Test Need help in getting code coverage its getting to 46%

I have written a Callout Class Called RestCallout which makes Callout to an end point, get the httpResponse as xml and from the body of response gets different elements and updates the database. For ...
2
votes
1answer
846 views

Username-Password OAuth Authentication for community users?

I have a native ios app and i want to login using the username password flow, From the POC i made i discovered that for community user, i dont get a security token which i was using while REST call to ...
0
votes
1answer
371 views

Endpoint URL for retrieving Marketing Cloud Users and Roles

I'm looking for endpoint URL to retrieve all users and roles in Marketing cloud. Looking at REST API Documnetation, www.exacttargetapis.com/messaging/v1 should have users and roles GET Operation for ...
3
votes
0answers
182 views

Another STRING_TOO_LONG problem, HTML text into a rich text area

I have a custom object with a rich text field, max size 131,072. Using the force.com REST API, attempting to add an entry with text size larger than about 63,700 characters (I have not pinpointed the ...
0
votes
1answer
605 views

How to create a File (a la Lightning) and link it to a Case via REST API?

In the Lightning UI if you attach a file to a Case it won't be created as an Attachment, rather as a File. I could not find anything about this in the REST API docs. What I found just by try and ...
0
votes
1answer
388 views

store custom exception in Event Log object

I am trying to create a EventLog (Custom object) record when ever a exception is caught. It works fine only when the system exception occurs (Like any DML operation. In my case If I call Update ...
0
votes
2answers
327 views

Salesforce REST upsert for externalId cause DUPLICATE_VALUE error

I send next upsert request to Salesforce: PATCH /services/data/v41.0/sobjects/Task/uuid__c/a22ac4d6-e2c0-4e53-898d-ea1d0c807775 HTTP/1.1 Host: **********.my.salesforce.com Content-Type: application/...
1
vote
1answer
51 views

REST Webservice

I am writing a REST webserviece where i am getting value from third party and then after getting that value i am trying to populate a VF page with those value. @RestResource (urlMapping = '/Telephony/...
3
votes
1answer
194 views

More detailed API statistics than The “API Usage last 7 days” report?

Recently had an API usage scare and found that the very loose "Day of the Week" column left a lot to the imagination about when that actual day starts. There is no documentation I've found that ...
0
votes
2answers
53 views

Need help Rest Webservices

I am new to Rest Webservices and need some help. I have a requirement where the external system creates an account and is calling the Rest webservice to send the created account details as a response ...
0
votes
1answer
252 views

Token access expiry time and how to expire token forcefully

Is it possible to know how much is the time limit of a access token for a connected Org. As till the extent I know it is equal to your activity on connected app or timelimit set in Setup -> ...
7
votes
1answer
2k views

What is the longest URI that Salesforce will accept through the REST API?

The Background I was handed a task to populate a developer sandbox with a limited set of data from our production org to allow another dev team to be able to test integration with a third party (with ...
1
vote
1answer
190 views

Twilio salesforce integration error while sending SMS more than 160 char [closed]

I am trying to send SMS from Salesforce using Twilio's REST API. I keep getting below response. { "code": 21605, "message": "The message body exceeds the 160 character limit.", "more_info"...
0
votes
1answer
403 views

Sorting list in replacing in a specific order

I need to sort a list in a specific order which is been provided from list wrapper coming prepared from custom setting.Final Wrapper and class includes the below code. global class vision { ...
0
votes
0answers
267 views

APEX Request giving “errorCode” : “JSON_PARSER_ERROR” } ]

I have built a rest service and trying to create a record with a field of currency type.The rest service looks OK when parameter is been passed with some value However when the format of the request ...
1
vote
0answers
52 views

C# Rest service and Sales force [closed]

I am having issues with my Rest calls, I am not even sure I should be using Rest at this point. But I currently have the following code in my Salesforce Development console and it call my C# Rest ...
0
votes
1answer
546 views

Special Characters in REST API

I'm using ArcGIS Online to Store some info and then later show it up on a Map. But, I'm having trouble sending data when it has special characters(in this case single quotes). Apex Code that makes ...
0
votes
1answer
444 views

Testing a REST Service POST method question

I am confused about some of the information in the developer Guide regarding setting up a REST Service POST method. I've set up my service similarly to the following example from the Developer Guide: ...
0
votes
3answers
498 views

Querying all the SandboxInfo via REST API

Our architecture uses Salesforce to send some emails to clients automatically, so to reproduce the full architecture in a demo environment we need to have an identical instance of Salesforce. We can ...
0
votes
1answer
15 views

Uploading Leads to SF Professional Edition using REST API

My company has a Professional Edition Salesforce instance. We're capturing leads on our company website. I have written a simple program that uploads sales leads using the REST API. It works fine ...
3
votes
2answers
3k views

converting string to Schema.SObjectField

I have created an API But struggling in converting String to Schema.SObjectField as If there is any possible way to cast string into Schema.SObjectField field type for example Account.example__c to ...
1
vote
1answer
112 views

Get Org URL Via Web Service

I've created a REST web service on Salesforce and exposed it as a public service (Using Sites). Now I am consuming this service from an external web site. I need to get the Salesforce base URL inside ...