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.

0
votes
0answers
184 views

APEX REST Web Service: Can not deserialize: unexpected array

It is working fine in workbench but when request is coming from middleware soa it is receiving error [{"errorCode":"JSON_PARSER_ERROR","message":"Can not deserialize: unexpected array at [line:2, ...
1
vote
1answer
51 views

Managing transaction in Integration with an external system

I make a callout by clicking a button on the page layout of a record(object-ABC). The record details are sent to external systems(another salesforce) system that creates a Case record in the external ...
0
votes
2answers
136 views

attempt to de-reference null object rest class

While performing a POST via workbench i am getting attempt to de-reference null object error in line no 32. I am not getting where i am doing wrong - Rest Class - @RestResource(urlMapping='/Order/...
1
vote
1answer
4k views

JSON Parsing of REST response

I am trying to integrate our Salesforce with Yodlee. I have been successfully able to send and recieve REST response to their test server. My issue is with the REST response body. Their REST response ...
0
votes
0answers
124 views

Assign Topic to article using Rest API > Response error Invalid value for article topic operation type: AssignTopicsToArticle

So I am trying to assign a topic on a specific knowledge article using Salesforce Rest API and following this documentation https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/...
0
votes
2answers
82 views

Nested REST API

I'm trying to implement endpoint hierarchy in one class. I want to make something like this: @RestResource(urlMapping = '/endpoint') global with sharing class Class1{ @HTTPGet global static ...
0
votes
2answers
733 views

Rest API call from apex Controller

I want to call a url using Rest API from my apex controller and show the response from that url to my visualforce page. I have written a code. But it is not working. Controller public class ...
0
votes
2answers
33 views

Limit records on REST chatter feed

I'm using the following (non-APEX) REST connection to retrieve chatter records from a unique chatter group (id.) How can I limit the number of chatter records retrieved? I only want to use the last 20 ...
0
votes
1answer
167 views

Error desearlizing JSON of type BatchInfo - Bulk API

I am trying to get the status,# record processed etc details by hitting the bulk API endpoint - /services/async/39.0/job/75037000003BXtw/batch In response I got the below JSON structure: {"batchInfo"...
0
votes
1answer
909 views

Salesforce Rest System.HttpResponse [Status=Not Found, StatusCode=404]

I need to invoke a REST class exposed in my own developer edition org.   Its a GET Method, and when I test the endpoint using Workbench, I get the expected result. Now the problem is, I created a ...
0
votes
1answer
479 views

Update Existing Record via Force.com REST API

My client has a Web-to-Lead form on their WordPress site that collects info and sends the data to Salesforce. Salesforce then creates a new record within a custom object. What I want to do is create ...
0
votes
1answer
217 views

Rest API to query for Products and prices

I have been asked to design some new forms that create Orders in Salesforce. To achieve this I call the webservices often using Query. For these new forms that are related to Ordering I had hoped to ...
0
votes
2answers
3k views

salesforce rest api invalid session id error when using access token

I am trying to retrieve data from salesforce using the REST api and CURL in PHP. I perform the authentication request and receive an 'instance_url' and 'access_token' but after performing a query ...
0
votes
1answer
678 views

2 post method in same rest class with same url one for update and one for delete

I am working on a rest class and have created different type of rest service with a defined URL. However, I was just going on a requirement and looking for the possibility regarding: Inside same apex ...
0
votes
1answer
66 views

Tooling API System.calloutException: You have uncommitted work pending. Please commit or rollback before calling out

I am using Rest resources to query tooling api objects. My code is as follows: public HttpRequest getObjectDescription() { String name = localName.replace('__c', ''); //localName is a class ...
0
votes
0answers
72 views

System fields in JSON request body

I am preparing dynamic JSON request body for the contact object fields using Schema.getGlobalDescribe class, but i am getting all the system fields in the request body like CreatedDate, IsDeleted, ...
0
votes
1answer
184 views

Ability to access 2GB files for external system

I am trying to grab large VersionData from ContentVersion for a REST service but HTTPCallout and HttpRequest only allows 12MB (Async). How can I get access to the 2GB files? Would that be through ...
0
votes
0answers
235 views

Convert ContentVersion blob to bytestream for OneDrive Upload (MS Graph API)

I'm attempting to upload a file (VersionData from ContentVersion) to OneDrive using the Graph API Resumable Upload Method: https://dev.onedrive.com/items/upload_large_files.htm I'm able to create ...
0
votes
0answers
62 views

Using REST API to recieve JSON

I have a requirement where a client wishes to send JSON to our org. I've not handled this before, is REST API the best way to go? They are going to use "webhooks to create and send a JSON form" to ...
0
votes
0answers
43 views

Salesforce REST API continuous authentication

Is there a simpler way of accessing my companies data through the REST API, and have the web server that fetches that data be indefinitely authenticated? I tried using the web server flow with a ...
0
votes
1answer
41 views

Does the REST API provide an equivalent method for the SOAP API's retrieve() method?

The SOAP API supports a "retrieve()" method that returns all records whose ID's are in some given list of ID's. Is there an equivalent in the REST API? The closest I could find was https://developer....
2
votes
1answer
682 views

How to consume REST service created in salesforce

I created a rest service in salesforce as below: @RestResource(urlMapping='/v1/accounts/*') global with sharing class REST_Account_Service_V1{ @HttpGet global static Account doGet(){ ...
3
votes
1answer
5k views

Malformed JSON: Expected '{' at the beginning of object?

I searched all over but not found the right one. My Body string below, [{"revokePermSetNames":["RemovPerm1","RemovPerm2"], "EmployeeNumber":"8507", "assignPermSetNames":["AddPerm1","AddPerm2"]}, ...
3
votes
0answers
121 views

why extra string append with the REST request?

I am trying to send this data to another salesforce org REST endpoint. map<string,Set<string>> mp = new map<string,Set<string>>() ; mp.put('Data1',new set<String>{'...
0
votes
0answers
257 views

How to solve Limit Exception : Too many query rows 50001

I have a code which retrieves and displays the results in the VF page from REST Web-Service. In one sandbox , it's working fine. But in other sandbox it returns following error: Limit Exception ...
4
votes
1answer
949 views

Integration with REST API that is not CRUD

I'm a developer working on an API that tries to be REST-ful, but is limited in terms of CRUD. Many entities expose a GET endpoint, but because many create and update actions have side-effects, we don'...
2
votes
1answer
4k views

What is the default timeout for httpRequest?

What is the default timeout for httpRequest. I have gone through this doc . But could not find the default timeout. public class HttpCallout{ @Future(callout=true) public static void ...
1
vote
2answers
2k views

ErrorCode 180008 - Unable to queue Triggered Send request. There are no valid subscribers

I'm trying to send an email by ET rest api in Java. I already successfully sent a SMS and got a token in response, but an error is triggered with emails. Here is the JSON I send : { "To": {"...
4
votes
2answers
140 views

Does IOT Cloud have REST APIs? Or does it uses third party platforms to connect devices to cloud?

I am working on integration services for salesforce. Salesforce has APIs e.g. for creating Account, Contact, Lead etc., making it easy to develop integration services. Now I have been asked to ...
1
vote
1answer
714 views

Accessing Apex rest class with OAuth 2.0 with Named Credential authentication mechanism

I have been trying to implement Oauth 2.0 in my org and my requirement is to use Named credentials only when making a apex callout. I am using Named credentials, Oauth, Connected Apps and auth. ...
0
votes
2answers
113 views

How do I enable access to my RESTful, public force.com service from C#?

I have a RESTful Apex service that I can browse to and call using my web browser. A problem occurs when I try to call it from C#: An unhandled exception of type 'System.Net.WebException' occurred ...
1
vote
2answers
287 views

Salesforce REST JSON not getting serialized properly?

Please help me to get this JSON string deserialize as map of list of string. public static void postPermissionSetAutoDelegation(Map<string,Set<String>> delegationMap,String OrgName) { ...
2
votes
0answers
135 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 ...
0
votes
0answers
606 views

Query string too long receiving 414 error

I am trying to work with the query object and build out a SELECT section of a query that includes all fields in the object using node.js libraries. Unfortunately, this object has over 500 fields and ...
1
vote
0answers
324 views

Problems with deserializing JSON to class

I have created a parser class to parse some JSON into an object. This is accessible as a REST based service. This is the class I parse to: global class statParser { global class Request { ...
3
votes
3answers
162 views

How to Break Down Object Data Type

This returns the Object in the debug logs: 'USER_DEBUG [21]|DEBUG|{amount=1825.73, currency=USD}' I really just want the price and could care less about the currency. How do I strip out just the ...
0
votes
1answer
205 views

is that possible to pass(POST) below JSON to REST endpoint?

I saw that we can't pass the Map<String,List<String>> to REST post method. So I decided to go with the json as like below. Will REST allow to post this similar json to REST? { 'Emp01' ...
3
votes
1answer
117 views

Upload assets to Site.com via FTP or REST API?

I am using site.com to host a mini site which works fine. I need another delivery method other than manually uploading my .zip file to my site as an asset. I have found a way to expose an endpoint ...
2
votes
2answers
799 views

Code coverage for @HttpGet / Rest method

i'm trying to do a test method to cover a @HttpGet method. I'm pretty new on apex and i don't really understand how test (method/class) works for this kind of things. Here is my method : @...
0
votes
3answers
1k views

Posting multiple values using Apex Rest callout with POST method [closed]

I am learning Integration from this Trailhead Pre-existing JSON at the endpoint {"animals":["majestic badger","fluffy bunny","scary bear","chicken"]} Code that i have written to add three more ...
1
vote
1answer
275 views

Chatter REST API Limit

Is there any way to increase the Chatter REST API limit of one poll per minute is a hard limit and cannot be increased? We built a connected app using REST from a 3rd party portal application and ...
0
votes
2answers
143 views

SOQL Query user

I am getting the following error using this REST query. I am able to successfully generate tokens and user info prior to issuing this query. I need to simply retrieve the salesforce userid based on ...
0
votes
1answer
329 views

RestRequest params do not handle multiple query params with the same name

I am working with a custom REST class that accepts @HttpPost requests. The main problem that I am facing is that when the content-type of the incoming request is set to application/x-www-form-...
4
votes
1answer
81 views

Why Salesforce REST API List View Describe Method returns extra values in columns list?

When I try to execute this request GET /vXX.X/sobjects/{sobjectType}/listviews/{queryLocator}/describe which is described in documentation https://developer.salesforce.com/docs/atlas.en-us.api_rest....
3
votes
0answers
189 views

Deploy Apex Class to another Salesforce ORG via Metadata API?

So I've been looking around to see if there is a way to push Apex Classes via the Metadata API, and I'm a little confused at the documentation. I've used the Eclipse plugin before, so I know that you ...
0
votes
1answer
174 views

How to filter selected checkbox fields from visualforce page?

i have a visualforce page with some fields all fields are check box fields. if i selected some chck box fields and after saved it. my requirement is how to filter in soql query for all selected ...
0
votes
1answer
294 views

Salesforce Username-Password OAuth flow without Connected App?

I have read the Salesforce documentation about username/password authentication here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/...
0
votes
1answer
73 views

Mix or blend SOAP and REST api?

I've been using the SOAP api for things. It's working really well for almost everything. The one thing that it couldn't do the last time I checked was pull a template from the ExactTarget platform and ...
8
votes
3answers
1k views

How to see JSON response for REST service?

How I can see what the JSON response looks like for a REST service that looks like the one below? I guess I'm looking for the actual steps of what I need to do to see the JSON response. @...
2
votes
1answer
2k views

System.JSONException: Unexpected character ('}' (code 125))

I am passing the below JSON structure using POST method to a apex service: I get an error at line where the codes variable ends { "PId" : "345", "Description" : "test", "Codes" :[ { "Code" : ...