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
-2
votes
0answers
19 views

how to write a test class for web service HttpPost

I'm new to development here I'm developing a webservice in rest and I have no idea about how to write a test class for that. Please find the below code of apex class: @RestResource(urlMapping='/...
0
votes
0answers
20 views

Rest Composite Resource

I try to insert a parent record with own child records using an external id (Serial__c field), but I receive this error: "statusCode": "INVALID_FIELD", "message": "Cannot reference a foreign key ...
-1
votes
2answers
25 views

Deserialize JSON Response from Rest Query, ERROR: System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set

Trying to convert some JSON to an Account List, I suspect my error is because the query next stuff coming into the response. How can I convert these results to an account list? HttpRequest ...
2
votes
0answers
19 views

LWC - Retrieving WAVE Dataset information

I'm trying to make a callout to /services/data/v45.0/wave/datasets in a lightning web component. I can successfully make the callout for the running user in apex using UserInfo.getSessionId() but ...
-3
votes
1answer
36 views

Sending status code with response using apex [closed]

I am working on a rest API using http post to get the params and create a record. After creating the record I need to send a response with the details of created record along with a status code and ...
0
votes
0answers
25 views

Updating Metadata of Standard Objects

Good day! I bumped into a question from here. I was wondering if there is a counterpart for this when it comes to Salesforce Standard Objects? Upon reading the answer, it suggests a library which ...
0
votes
0answers
14 views

How to delete all rows with certain condition using Marketing Cloud Rest API

I'd like to hit a rest API and delete all rows in a data extension. The data extension doesn't have a primary key, but it has a "condition = x". For instance: condition, value x, 11 x, 22 x, 33 y, 44 ...
1
vote
1answer
47 views

Calling a REST API with a preset token

We have a need for equipment to post status updates to salesforce. Unfortunately the equipment lives on a secure network that will not allow return communication The methods I see all require a ...
0
votes
2answers
43 views

Salesforce Rest API, Issue in getting Params from Rest API

In the below code, If I print the String variable report, I am able to get only half of the string that is 123 characters, while the external person is actually passing me a string that contains ...
0
votes
0answers
49 views

Apex callout yields “Ending position out of bounds: -1” error

This is my vf page <apex:page controller="AccountRest"> <apex:sectionHeader title="Accounts" subtitle="List View"/> <apex:pageBlock> <apex:pageBlockTable value=...
1
vote
1answer
49 views

Apex callout with a client certificate

I have written one Rest service which is returning a access token to resend it to endsystem to get the final response but we are getting "Request processing failed; nested exception is java.lang....
0
votes
1answer
24 views

Help debug MobilePush send

I am trying to use Triggered API to send a Push notification. Can anyone help me debug what could be wrong with this simple code? I have the right Client Secret and ID as well as mobilepushlistid. %%[...
1
vote
1answer
30 views

nforce org.getUrl(url,cb) - value of url

I have a Node app running on heroku where I am using the nforce lib. I received { Error: Could not find a match for URL error.} while using org.getUrl from nforce library. For the url string, I have ...
0
votes
1answer
38 views

What's the problem with this backslash in SOQL query?

I'm receiving a String query with query params (via URL), and one is mandatory and seven are optional. So if i don't receive a param, shouldn't be included in the query. For instance: My code is: ...
0
votes
0answers
50 views

Create a StandardValueSet via Tooling API

I am currently working on StandardValueSet and I would like to try to insert an entry in the said resource. I looked at the documentation and it sort of lacks the necessary information for me to be ...
0
votes
0answers
55 views

Escaping HTML in JSON in rest callout

I am sending some html content inside json in the body of a REST callout from Salesforce to Dotdigital per their specs which is working well overall. string.escapeHTML4 is handling most of the ...
0
votes
0answers
17 views

how to add Loop conditions in apex test classes? [duplicate]

Could anyone help me how to write a test class for this logic.I'm little confusing here. public with sharing class XMLparserForIds { public String XMLString1 = '<?xml version="1.0" encoding="...
0
votes
1answer
34 views

not able to access the variable values after using the continuation class

private class StateInfo { Account acc {get; set;} StateInfo(Account acc){ this.acc = acc; } Contact cont {get; set;} StateInfo(Account acc, ...
0
votes
1answer
52 views

CLoudingo: SFDC Rest API JSON callout. 400 error returned

The code below is running, i had to pass on the login credentials to Cloudingo because it is/was a stateless REST API call from SFDC to CLoudingo. Have to hardcode the key/password into the SFDC Code. ...
1
vote
0answers
20 views

What API limits are imposed on Knowledge Base REST API?

I would like to know what limitations are there on the Knowledge Base REST API? Would this use the same API limits imposed in a Salesforce org? or does it also use the Site.com limits (number of page ...
0
votes
1answer
69 views

Rest API request on behalf of specific user

I have to retrieve data from Salesforce (using default endpoint for Rest Api SOQL queries) for a specific user. Now for getting Access_token I'm using "grant_type: password" with "System User" who has ...
1
vote
2answers
61 views

HttpResponse[Status=BAD_REQUEST, StatusCode=400]

I'm trying to sending a field value to third part but here the issue is Suppose the filed is Name = "Test Account" here in this case call will be failed but for suppose Field Name is like Name = ...
0
votes
1answer
37 views

Auto Refresh Access Token

I have written this method to get accesstoken when I send Id & password given(Which I havent Hardcoded Below). I am saving my access token in custom setting and want it to expire, call this method ...
1
vote
1answer
81 views

Get the Info of a REST API Sender

Is there a way to get the Sender info in a Rest WebService? for example : Part A - Sender sends this JSON Via POST Request : Http httpProtocol = new Http(); HttpRequest request = new HttpRequest();...
0
votes
0answers
36 views

How to call REST API from Javascript

I have REST end point (like http://18.xx.11.212:8010/KKT/getteledetails) and parameters are in JSON format like { "teledetails" : "AHG45", "StartDate" : "" }. Now I want to call the above REST ...
0
votes
0answers
9 views

Outbound messages removes TextArea Long, for bulk data upload

I built a Outbound Message endpoint, which works like a middleware, and calls other endpoint, which is REST based. When I create/update a single record, it sends all the info specified in the ...
0
votes
2answers
38 views

Can we send Rich text Field's HTML from Service Cloud to any other system Via API

We have a use case where the Users will make text entries in a Rich Text Salesforce Field and will do customization on the input text field with the salesforce provided rich field's capability. We ...
-1
votes
1answer
48 views

How can I use OAUTH on Salesforce Live Agent REST API

We want to use OAUTH - userid/password flow to access salesforce live agent rest API. We have implemented this for other rest api provided by salesforce. However the live agent rest api are wide open ...
2
votes
2answers
59 views

Calling REST APIs based on a session established via a community login

I'm currently dealing with an authentication issue with two different Salesforce REST API endpoints. We are trying to consume the API from inside a Visualforce page in a Salesforce community. To do ...
3
votes
1answer
46 views

REST API 12MB Limit

I'm receiving a PDF in Base64 from an external web service, the PDF is received in JSON along with some other details. Is there anything I can do to avoid the Heap size being blown when converting the ...
0
votes
2answers
83 views

Marketing Cloud API CORS problem

I would highly appreciate if anyone could help me in handling CORS policy for Salesforce Marketing Cloud API requests… The situation is following: I need to make direct API calls to Marketing Cloud ...
1
vote
1answer
38 views

REST API for metadata components / types?

I have been doing some research and I am unable to find the correct endpoint for fetching Metadata Types & Components. Somehow, in workbench they are able to fetch this information and it can be ...
2
votes
1answer
69 views

Difference between Authorization Code and Access Token [closed]

Can you please explain the difference between authorization code, access token and bearer token? I've been looking for this on Google but didn't clear things for me. From REST API dev guide all I ...
2
votes
2answers
45 views

Which endpoints are supported for OAuth2 token authorization?

Documentation says that for OAuth2 token authorization URL like login.salesforce.com should be used For authorization: https://login.salesforce.com/services/oauth2/authorize For token requests: https:...
0
votes
0answers
40 views

401 Unauthorized Invalid_session_id error while using refresh token

3rd Party app needs to access Salesforce resources without user interaction. I am trying to use OAuth refresh token - Refresh token . I generated an access token and a refresh token using postman and ...
1
vote
1answer
156 views

Apex Rest - Api error handling HTTP status codes

I am trying to handle multiple error codes in my REST service. Can anyone guide me if I am doing this correctly. try { if(Limits.getDmlRows() < Limits.getLimitDmlRows()){ ...
0
votes
1answer
34 views

How can I add “set-cookie” to a RestResponse?

A few years ago, Salesforce disabled debug logs for REST guest calls. The only way to enable generating the logs is to add a cookie to the incoming call. Docs here. The incoming call in my case is ...
0
votes
1answer
46 views

Rest API Salesforce with Certificate

I have a Rest API Service: @HttpPost global static String actualizarAveriaIngenico(String numorden_stu, String numproceso_mant, String estado_averia, String nombre_tecnico, String ...
0
votes
0answers
27 views

Fire event using oauth

Switching from the generic endpoint to tenant endpoint is giving me issues injecting a contact into a journey. If I test the setup in postman everything works fine. Converting the 'old' method to the '...
1
vote
0answers
61 views

Tooling API not retrieving relationship name/label

Querying on Customfield using Tooling API in workbench is returning relationship label "null" even if object has the relationship field(lookup/master-detail). For Example: My Object has 3 relationship ...
1
vote
1answer
43 views

How can I disable my existing Apex REST Webservice in production?

I have an existing Apex REST Webservice configured in production for consumption by a partner for Lead creation. However, we are not working with that partner anymore and hence want to disable this ...
0
votes
0answers
8 views

OBJ: Product2 - Scheduling is not enabled for this type: Revenue Schedule Type Via OData

We just enabled revenue scheduling for client as soon as we enable revenue schedule, we no longger able to edit or create product via REST API, and receiving "OBJ: Product2 - Scheduling is not enabled ...
0
votes
0answers
14 views

How to authenticate REST API without being redirected to the Login page? [duplicate]

I have a Web application on a remote server that needs to send a JSON object(generated on my user's browser) to be stored on my SF object. The problem is that according to the documentation and a few ...
0
votes
1answer
63 views

How to insert order and orderitems in single rest call in salesforce

How to insert order and orderitems in single rest call in salesforce? Add an Order to an Existing Account https://developer.salesforce.com/docs/atlas.en-us.api_placeorder.meta/api_placeorder/...
0
votes
0answers
13 views

Download ContentNotes linked to entities by others

I have an org with SNotes enabled. I am trying to use REST API to query SNotes on Account. If the current user adds an SNOTE, then a simple SOQL query like so returns it: GET /services/data/v42.0/...
1
vote
1answer
108 views

REST Request - AWS Access Key ID and AWS Secret Access Key [closed]

I am reading this document Authenticating Rest Requests The first paragraph says .. Every non-anonymous request to S3 must contain authentication information to establish the identity of the ...
0
votes
0answers
34 views

Performing multiple operations on same record in same transaction [duplicate]

I am trying to do three operation using same record. First Operation: Set ContentDocument isArchived field to false. Second Operation: Grab contentdocument by calling REST API Endpoint. Third ...
0
votes
1answer
50 views

Convert hierarchically structured JSON data into a list of sObjects Contact

My webservice contains hierarchical data so that I cannot transform it into an sObject when making the GET request. Here is an example for Contact, but the phone number is grouped so that I cannot ...
0
votes
1answer
30 views

Restructure hierarchical data in a REST callout

I found contact data as JSON on the web that is not organized as the Contact sObject as the phone number is being stored as hierarchical data: please see https://api.androidhive.info/contacts/ for the ...
0
votes
1answer
49 views

How to Retrieve large data from Salesforce using Rest API?

I have one new requirement where My client wants to retrieve large data set (~80K records) from Salesforce daily. I have created rest web service but it returns only 2k records. for 80k records, do ...