• Roy J 6
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies

When attempting to retrieve some information from an external API, I receive a "Status:Method Not Allowed" issue. However, the same API is working in Postman, where I am seeing the problem inside Apex. Would you kindly assist in finding a solution?

GET is the API method;
Body request: {"records":[ 493672139 ]}
Due to some reason, I couldn't provide the API details. Kindly share your thoughts

Apex code:
JSONGenerator gen = JSON.createGenerator(true);
List<integer> intlist = new List<integer>();
intlist.add(493672139);
gen.writeStartObject();
gen.writeFieldName('records');
gen.writeStartArray();
for (Integer record : intlist) {
    gen.writeNumber(record);
}
gen.writeEndArray();
gen.writeEndObject();
String pretty = gen.getAsString();
HttpRequest req = new HttpRequest();
Http http = new Http();
HttpResponse response = new HttpResponse();
req.setEndpoint("");
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Authorization', '');
req.setBody(pretty);
req.setTimeout(90000);
response = http.send(req);

 

hi, all I create a salesforce API and try to connect in another system but I getting a cross-origin error.I added my domain in connecting app as well CORS whitelist domain. help how to solve the problem


Hi all
I am working on salesforce mobile app push notification functionality via the help of firebase but not able to achieve my need .i am trying to send a notification from firebase to salesforce mobile app and am not getting clarity on that how to configure/documentation .give any suggestion how to Achieve firebase to salesforce

Thanks 

hi all i am working on salesforce lighting mobile app i am trying to implement push notification in salesforce app for past two days but i am not able to get a proper solution/documentation pls anyone help how to implement push notification in salesforce App
In salesforce i am work on contact object when user enter a contact details based on address automatically get long and lat with the help of google API any suggestions
Hi all i am working with future method functionality call the future class in after update trigger i control the recursive update too. future method is inside method i get one list and modify it then load one mater list finally update but i can't update   i am getting error like this,
Error:first exception cannot_insert_update_activate_entity execution of afterupdate
Any Suggestion
I have created a custom button in salesforce account using visualsource page. The button was working fine till yesterday morning. After that whiile executing the code got an error as  "Failed to load resource: the server responded with a status of 500 (Server Error)
send @ connection.js:595
PearlBtn?id=0061t000008MKxrAAG&tour=&isdtp=p1&sfdcIFrameOrigin=https%3A%2F%2Fgreencrosstraining.lightning.force.com&sfdcIFrameHost=web&nonce=f09fc07f85f4d913a716b69e313d3a03ef06c8efbeea90c656c50ffceff3666d&ltn_app_id=06m1t000000ZIQzAAO&clc=0:56 An unexpected Error has Occurred. Error: {faultcode:'sf:INVALID_SESSION_ID', faultstring:'INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session', detail:{UnexpectedErrorFault:{exceptionCode:'INVALID_SESSION_ID', exceptionMessage:'Invalid Session ID found in SessionHeader: Illegal Session', }, }, }".

Please clear my doubt as it is urgent.

Thanks


Hi all
I am working on salesforce mobile app push notification functionality via the help of firebase but not able to achieve my need .i am trying to send a notification from firebase to salesforce mobile app and am not getting clarity on that how to configure/documentation .give any suggestion how to Achieve firebase to salesforce

Thanks 

No matter which domain I pass in, I cannot get it to work. How do I whitelist a domain for CORS in salesforce?