Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
2answers
6k views

how to call rest API from Html or javascript

i have one rest class for insert account , it's working with workbench.developerforce.com but now i want to call same using HTML or JavaScript , how can i do ? My Code : @RestResource(urlMapping='/*...
2
votes
1answer
2k views

Debug Log not working with RESTResource

I have the following class: @RestResource(urlMapping='/myservice') global with sharing class MyService { @HttpPost global static String newMessage() { RestRequest req = RestContext....
2
votes
3answers
561 views

How long does it take a create/update/delete to complete with the REST API?

The logic for my code is: look for a Lead with a specific email; if none exists, create a Lead with that email address. The problem is that this code is running pretty frequently for the same email ...
2
votes
1answer
1k views

Web Service limits for inbound calls to managed package

I am developing an AppExchange managed package intended for multiple organizations. I have a web-service in the managed application which I will invoke from my java based server to achieve few ...
2
votes
1answer
816 views

Salesforce to Amazon S3 - policy and signature generation

Description In order to upload files from a visual force page to s3 via AJAX. I had to find a way to generate a valid s3 policy and signature. The issue How to generate a signature and policy in ...
2
votes
1answer
563 views

How to get instance name/key via API

Is there a way to get the instance name of a Salesforce organisation (like na41) via the REST API in a reliable way? I've looked at existing resources available and they do not seem to expose that. I ...
2
votes
1answer
1k views

Getting OAuth access token for my Marketing Cloud App in App center

I have created an App in Marketing Cloud in App center, as off now the app summary page gives me Cilent Id, Client Secret and Application Id for my App. But, I also need OAuth token for connecting my ...
2
votes
1answer
467 views

Wave REST API returns BAD REQUEST ERROR 400

public class SendWaveUsingRESTAPI { private final String clientId = 'xxxx'; private final String clientSecret = 'xxx'; private final String username = 'xxxxx'; private final String password = '...
2
votes
1answer
814 views

can we execute webservice from developer console

@RestResource(urlMapping='/Merchandise/*') global with sharing class MerchandiseManager { @HttpGet global static Merchandise__c getMerchandiseById() { RestRequest req = RestContext....
2
votes
1answer
520 views

How to create trigger for DatedConversionRate object

We're using multicurrency in our project. DatedConversionRate has been updating every day by external process. The requirenment is to update CurrencyType records with most relevant rates. At the ...
2
votes
1answer
101 views

Return a response after calling a REST point created on salesforce, while the REST point is calling a @future method

I have crated a RESTful endpoint on my sandbox. When it is called with the proper input it creates a new contact and then decorates a custom response class I created for that purpose and at the end it ...
2
votes
1answer
358 views

Assignment rule always auto fire with no reason

I got a project which needed to setup an public community as an endpoint to receive JSON messages (URL post method). My community home page got a restful apex class to receive message and process it ...
2
votes
1answer
3k views

System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set while deseriliasing json Payload

> I have resolved the issue updating answer for my own question thanks for response Stack-exchange great help everytime : > > > 1.Malformed JSON: Expected '[' > > Answer:...
2
votes
1answer
756 views

JSON.deserialize with arrays with one to many elements

I am consuming a REST service with APEX. Here is a response sample: { "createQuoteOutput": { "response": { "quoteNumber": 945, "temporaryQuoteNumber": "T8652" }, "...
2
votes
1answer
523 views

Rest Response Data Styling

I am using a Force.com site to expose a Visualforce page which calls out to the Stripe API via Javascript for a financial transaction. It's all working perfectly, but I am new to REST and can't quite ...
2
votes
1answer
40 views

Reg : Sending Response for insert records

i wrote a rest service i am inserting 2 fields if i get any null value for any field i have to send the JSON response to the third party server can any one suggest me where i have to change my service ...
2
votes
1answer
29 views

Number of Execution Contexts during Callouts

I am trying to understand how execution context works with respect to callouts. Use case : Whenever an Account's status is updated to "Ready for Integration", a REST callout will happen towards an ...
2
votes
2answers
2k views

API for Validating OAuth Access Token

Here is my usecase, I have two apps, one written in rails and other is written in R. App written on rails acts as landing page. From there we can go in to app written in R. We are using Salesforce ...
2
votes
1answer
55 views

How to get employee count via joins

I am trying to write a function that returns a list of companies and how many employees are under that company but am unable to figure out how to do this in a single request. Given: search term = "...
2
votes
1answer
808 views

REST API cc and bcc for Triggered Send

Does anyone know if CC and BCC was ever added as capabilities to the SFMC REST API for Triggered Send e-mails? The last question I could find here... Exact Target Triggered Send using REST API, ...
2
votes
1answer
344 views

Apex Rest API Public Web Service Cannot See Data?

I saw how to implement public REST API with Salesforce, Can I have a public APEX REST API? https://developer.salesforce.com/blogs/developer-relations/2012/02/quick-tip-public-restful-web-services-on-...
2
votes
1answer
2k views

Webcallout through proxy

We have a webservice they is being moved to a proxy. It works when calling it by normal means (using Advanced REST Client plugin), but when calling from Salesforce we get an 'Unable to Tunnel through ...
2
votes
3answers
1k views

How to get SObject type from object Id using REST API?

I have an object id that is a "parent id" of a specific Attachment object (e.g., b3KD0000119wDTlMAN). I'd like to understand what type this object belongs to, to query for it's details. It can also be ...
2
votes
1answer
821 views

Is it possible to add rich textbox with image via rest?

I'm wondering whether it would be possible to add text with image to rich text area field by rest. How should be done and how would i have to make such a request?
2
votes
1answer
1k views

Exact Target Rest Auth API

I'm trying to call the exact target auth api for the first time. I'm getting a 407 Proxy Authentication Required. Can you please let me know where I'm going wrong. I'm using the following call ...
2
votes
1answer
683 views

Can you call a REST service from Eclipse?

Can we call a rest service from Eclipse? We can call REST service from workbench to test whether its working fine or not. If you want to see the logs, we wont be able to see the whole log in ...
2
votes
1answer
401 views

GET method for download WSDL

I want to download wsdl file programmaticaly, using my Web JavaScript application. First I do Oauth login and get all tokens. Then I try to download WSDL file using JavaScript: var xmlHttp = ...
2
votes
1answer
679 views

How do I prepare Salesforce to accept HTTP request from an external system?

A text messaging system we're integrating with includes a feature that sends an HTTP request to a URL with message receipt data but I'm not sure how to prepare our Salesforce to deal with it in the ...
2
votes
1answer
113 views

Is it Possible to define the Subject/Body of a Message at Send Time?

Is there a way to send a completely dynamic message through ExactTarget? We would like to create a "template" email, and then if at all possible, specify the subject and body of the email/message ...
2
votes
1answer
282 views

Adding object through REST API not appearing on chatter?

So my problem is that when i create an item, for example a new contact, which is related to an Account, the action of creating that object doesn't get shown on the chatter feed for that account. I ...
2
votes
1answer
33 views

is it possible to save data of my customized application in visual force workbook to my own database with out using salesforce database

I created one application in salesforce.com.That application contains create,Update,delete,GetList buttons.Is it possible to save data in to mysql database(my local database) when user clicks these ...
2
votes
1answer
27 views

POST a record from Org1 to Org2 with JSON and Map

I need to post created record from Org1 to Org2. I want to "put" my JSON into Map and just "open" Map in another Org. Needed result: fields from new Org1 Object's record = fields from new Org2 Object'...
2
votes
0answers
150 views

How do I access a Rest endpoint on a scratch org?

I've set up a connected app and a rest endpoint on a scratch org but can't access it through either the workbench, Postman or client code. I get the following error in each case: 404 Not Found ...
2
votes
0answers
35 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 ...
2
votes
0answers
208 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-...
2
votes
0answers
432 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 ...
2
votes
1answer
336 views

Sending batch rest api request from apex

I need to get multiple data from salesforce. To get the resource i call the endpoint as shown below. public String getData(Id docId) { HttpRequest request = new HttpRequest(); request....
2
votes
0answers
173 views

Bug? FieldDefinition is Createable via Tooling API

I found this question very interesting: Programmatically Determine Which Objects Allow Lookup References to Them? In my naiveté, I thought perhaps this question could be answered by using the Tooling ...
2
votes
1answer
754 views

Apex REST API escaped quotes

I'm trying to build a slack integration with an apex rest endpoint. and I need to get a message in a format such as below. Normally I would create an object and return the object, however slack uses ...
2
votes
0answers
229 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
1answer
372 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 ...
2
votes
1answer
260 views

Salesforce Javascript CORS rules

Is there a good summary of where from Salesforce allow and does not allow calling out to 3rd party REST API's (assume header Access-Control-Allow-Origin: *). Possible scenarios I can imagine: ...
2
votes
0answers
47 views

Fetch Data of Different Organization?

I have 2 Orgs- Org A & Org B both are ap1 Instance In Org A I've created a Connected app In Org B I am trying to Query accounts of Org A From the Connected App Through Http Call, but I am ...
2
votes
0answers
30 views

Case Closed Layout REST API

Anyone our there know if there is any way of retrieving the Case Closed Layout details using REST APi at all?! My googling skills are not coming up with any trumps here
2
votes
1answer
185 views

Calling Chatter API with in salesforce“INVALID_SESSION_ID”

I am trying to call a chatter API with in salesforce and i am getting the below error message. Error Message: DEBUG|[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] Code: ...
2
votes
0answers
407 views

Connect to external HTTPS REST API

I'm looking for a solution how to connect to external API with Salesforce. The API I want to connect with is a HTTPS url, with some parameters. (https://www.url.com?param=...) Here is the code I ...
2
votes
0answers
128 views

Performance issue when offset used in SAQL

I am using the endpoint data/v35.0/wave/query to execute a SAQL query. When I execute the below SAQL which does not contain offset, I am getting the response approzimately in 1 secs load \"xxxx/xxxx\...
2
votes
1answer
855 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 ...
2
votes
0answers
812 views

How to pass the parameters from one salesforce org to another salesforce org?

VF Page <apex:page controller="Apex_Rest_DemoController"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Create ...
2
votes
1answer
703 views

How to access force.com Rest Api from Site.com? [duplicate]

I need to call an authenticated Apex Rest API from Site.com page. The way I am trying is using Username-Password Oauth authorization flow, to get access token. Below is the javascript code I am ...