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

How to Convert Candidate Patient record into Salesforce Account in health Cloud?

I'm creating patient records through apex REST api in Salesforce Health Cloud.Actually Patient records have Account lookup field.How can I convert newly created candidate patient record into Patient ...
0
votes
0answers
35 views

Rest api not returning notes via get service in workbench

I am using workbench get service to get enhanced notes child records for a given account. Even though enhanced note data is present for that record, I am not getting any data back from the service ...
3
votes
1answer
529 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 ...
-1
votes
1answer
31 views

Rest API response to deserialise in to map to compare the data with other object.Value is not comparing and hence campaign data is not updating [closed]

http request : My intention here to compare the resopnse data with campaign object data and then update the campaign Http http = new Http(); HttpRequest httpReq = new HttpRequest(); ...
0
votes
1answer
35 views

Can't create assets outside parent folder via Fuel SDK

I'm trying to create assets using the Marketing Cloud PHP Fuel SDK, and I'm running into a problem where the assets are being created (as in, I can retrieve a list of assets and see the assets I've ...
0
votes
0answers
19 views

I cant able to get more code coverage cant able to parse json deserilalize code [duplicate]

I am inserting multiple invoice and invoice items at using post web service REST API Bulkinsert_InvoiceInvoiceitems class @RestResource(urlMapping='/InsertInvoiceandInvoiceitems/*') global ...
1
vote
1answer
469 views

User and profile for REST API only

I am developing integration in Salesforce with external application. This app uses my api by OAuth password flow. For this I have created user and profile, restricted access to all tabs etc. Are there ...
22
votes
2answers
1k views

Apex Framework / library for consuming REST services

To consume REST services there is a lot of boilerplate code needed: Build Apex Objects to model the responses Code to deserialize REST responses to those classes Handling of HTTP requests, responses ...
1
vote
0answers
516 views

First REST API Call for the day taking more than 40 seconds

We have exposed a custom rest webservice to perform dml operation on Case. We have a custom metadata where we fetch for a particular record based on the request parameter and populate the values for ...
6
votes
1answer
284 views

Message sent through Marketing Cloud isn't delivered and doesn't show up on the deliveries endpoint, what can it be?

I'm making a call to Marketing Cloud's endpoint to send SMS messages like this: -- request to /sms/v1/messageContact/{messageId}/send { "mobileNumbers": [ "55009999999999" ], "...
0
votes
1answer
46 views

REST Api Contracts and Documentation

I'm integrating with an external system, they will be able to send a POST request through REST API and create records of a custom object I've created in my org. I need to send to the client the ...
1
vote
1answer
122 views

Using curl to make a REST API call

I need to call a rest API service in Saleforce from an external client. This application logins in Salesforce with the SOAP standard login service and then has to call some custom services. The ...
0
votes
2answers
44 views

Using Salesforce oauth to make calls to own account/app

We use salesforce in our website. I'm new to it, and still can't find a way to calls REST api to our own account without going long way of visiting oauth login page, granting access etc(oauth flow). ...
0
votes
1answer
91 views

Internal Server Error When POST to Marketing Cloud create contact REST API

I am getting an internal server error when trying to save a contact in Marketing Cloud with Rest API. The body of my request is: { "contactKey": "acruz@example.com", "attributeSets": [ ...
-1
votes
2answers
162 views

Empty request body when when using curl

I have a rest service in salesforce which it has to receive different requests. When I test the service sending requests, if I use a REST Client I am able to get the requestbody properly but if I use ...
0
votes
1answer
587 views

Post request returns error 405 on ngrok

I'm using ngrok in order to tunnel localhost and check my REST request from Salesforce. However, when I send POST request I get error 405 - method not allowed. Below there is my code: HttpRequest ...
0
votes
0answers
117 views

Setting up Named Credential for External Rest API with OAuth2.0

I am trying to understand how to set up the Named Credentials & OAuth Provider in Salesforce for calling the External REST API. Before setting this up I tested the call to the REST API through ...
1
vote
1answer
69 views

Calling out via Named Credential - API vs Token endpoint

I created Named Credentials to authorize the api and got the token. Now i want to use the same end point to get the weatherdetail. when i tried to access same named credential then its showing error ...
1
vote
0answers
72 views

REST services getting empty result for User object

We set up a REST service to retrieve data from our org. Everything works great, except for the queries to the User object. When the query returns we get an empty list. This used to work (it was ...
0
votes
0answers
17 views

Converting a cURL to Apex Request [duplicate]

curl -X POST https://api.voilanorbert.com/2018-01-08/search/name \ -u any_string:{secure_token} \ -d domain="example.com" \ -d name="Fake User" I am strugging to convert the following into an Apex ...
1
vote
1answer
27 views

Getting LastModifiedDate of a Component File?

There is a post from 2019 here that details obtaining a couple of fields about a Lightning Web Component. Is there a way to get that information programmatically? Could not tell if trying various ...
0
votes
0answers
21 views

How to render content on mobile app through salesforce rest api when the service is sending string value consisting of <div> tags

discriptionvalue += '<div style="font-size:18px !important;font-weight:bold !important;">'+ s.Title__c + '</div>' ; Note: Need to render the discriptionvalue in my app with the style ...
0
votes
1answer
32 views

Parsing nested object

I am trying to parse the 'events' and 'consumer' details from this payload using Apex but am getting stuck getting to the eventData. Could explain how I would correctly retrieve those objects? ...
6
votes
1answer
11k views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.0 404 Not Found”

While trying to call REST web service, i am getting callout exception while doing authentication. follow is the Code spinet, ulr and token is updated for this example. Http h = new Http(); ...
-1
votes
2answers
87 views

how to create and send the request/response body for the post method in test class [duplicate]

static testMethod void testPost(){ RestRequest req = new RestRequest(); RestResponse res = new RestResponse(); Profile testEditorProfile = [Select id from Profile where Name= :System....
0
votes
1answer
65 views

Problem with Rest Webservice Code coverage [duplicate]

I have the following set of lines in my code RestRequest req = RestContext.request; RestResponse res = RestContext.response; AreaRequestWrapper areaRequestRecord = (AreaRequestWrapper)...
0
votes
1answer
84 views

REST Method to update the a contacts status in the All Subscribers list

So far I have succeeded at updating a contact's email address using the REST API and this method. The JSON body of my request looks like this: { "contactKey": "[MY_CONTACT_KEY]", "...
1
vote
1answer
117 views

URL doesn't exist in REST api call

I'm trying to subscribing platform event channel through REST. I have executed below code I'm getting the error called "URL doesn't exist". Is there any changes needed in the url format. Please ...
1
vote
1answer
78 views

Getting content using force.com sites in salesforce

I have a requirement where i have to download archived content from external system. However, salesforce does not allow to get archived content from REST API. The way i can download the archived ...
1
vote
1answer
79 views

SOSL using POST REST /parameterizedSearch API

I got the "/services/data/v46.0/parameterizedSearch" POST API working for a complex SOSL search I want to perform. I am referring to the Salesforce documentation here: https://developer.salesforce....
4
votes
1answer
52 views

Post a JSON payload with illegal characters / binary in it [closed]

I recently worked on an issue where a json payload with binary content was posted to a rest service which resulted in Blob.toString() raising a 'BLOB is not a valid UTF-8 string' exception. We're ...
2
votes
2answers
39 views

RestResource extracting array from JSON packet

I am currently receving a JSON packet from an external server and placing the values in variables for further use. The JSON packet has an array that can and will grow depending on the amount of assets ...
2
votes
2answers
2k views

Display dashboard in VF Page

I want top display dashboard in VF page. When I am trying to do it using blank window appear. <apex:iframe src="/01Z28000000Hdzo" > Right now I am doing as per follows. Page - <script ...
4
votes
1answer
2k 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
0answers
28 views

Added my first package with API Integration Component. How to test an API call (SOAP or REST)? [duplicate]

I am a developer but I admit I am confused by going through the Marketing Cloud API documentation. Inside our Marketing Cloud's installed packages, I created a new package and added an API ...
1
vote
1answer
43 views

Receive and handle POST from external server outside of Salesforce [closed]

I am trying to accept a JSON payload that is supposed to create new assets in the Asset sObject. I'm trying to wrap my head around how to expose the API to the server that is sending the POST request. ...
0
votes
1answer
47 views

REST API GET Callout and test method

I have created a class Apex class to get info from and external database and insert the info to the account before save. The method is called by a trigger. Everything is working fine but I am getting ...
0
votes
0answers
50 views

REST API Create Multiple Records

Create multiple records with reference to the official documentation:Create multiple documentation url But I need to fill the lookup field value, I found the official document again:update ...
0
votes
1answer
32 views

Set Email Subject and Body From API [closed]

Looking at the Marketing Cloud API (specifically the REST Reference), I can't seem to find anything that allows you to set the subject and body of an email. Is there some work around or way to do this?...
1
vote
1answer
1k 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
30 views

ApexREST Websrvice StatusCode with ResponseBody

I am writing a REST Webservice and have the following piece of Code. @RestResource(urlMapping='/UpdateTransaction') global with sharing class OpportunityTransaction { @HttpPost global static ...
0
votes
1answer
129 views

How can i use Marketing cloud Rest API in client side?

Im trying call one endpoint from marketing cloud rest api with AJAX, but im having problems with CORS. This is the error: No 'Access-Control-Allow-Origin' header is present on the requested resource. ...
0
votes
2answers
506 views

How to get Data Extension ID using Journey ID

In Salesforce marketing cloud, I need to get the Data Extension ID of a journey using REST or SOAP API Call. Then this Data Extension ID will be used in further set of API calls. The challenge was to ...
0
votes
1answer
128 views

API call to external system to pull data to marketing cloud

Is it possible to make an API call from the marketing cloud to pull data from external system? One way to do it create a script activity and schedule it or calling the activity through API. Real ...
0
votes
1answer
85 views

Salesforce cURL Example with Session ID is not working

I'm trying to use the Salesforce Rest API with the session ID I received via a SAML Response from the same Salesforce Instance (as IDP) but I get the message: [{"message":"This session is not ...
0
votes
1answer
21 views

Custom exception on Service Response with Standard API

Using standard API, when i receive a POST, if things go wrong i must return an error response. Since i'm not using a custom web service but a TriggerHandler, when one of the required parameters isn't ...
2
votes
2answers
2k views

How to make valid JSON Response from http POST method's Response?

How to remove the escape characters"\" from the Response and the the double quotes at the beginning and the end from the Response ? please check the expected valid response in the below. Code : @...
0
votes
1answer
41 views

Authenticate Calls made to Salesforce webservice [duplicate]

I am using this exact example from trailhead https://trailhead.salesforce.com/en/content/learn/modules/apex_integration_services/apex_integration_webservices @RestResource(urlMapping='/Cases/*') ...
1
vote
2answers
52 views

JSON Date field Error

I have the JSON string below that is being sent to a Salesforce Webservice: {"Opportunity": {"Id":"006g000000IiM5z", "Appraisal_Date__c":"2019-11-22"} I serialize the request into a Map and am ...
4
votes
3answers
9k views

What is the maximum number of records I can send per RESTful API call?

There is a maximum batch size for the number of records returned by an API call. Most of the documentation for the API calls reference including a .json file, and some, like the Update a Record page,...

1
2
3 4 5
15