• sunu j
  • NEWBIE
  • 0 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Http callouts returns json response.getbody() which contains data  with ' (eg, o'reilly). 
i have to deserialize this data to store it into custom object.
Do you all think can i still use deserialize straight way or any other suggesion?
  • April 25, 2014
  • Like
  • 0
Hi all,
I have access an external api, using api key to retreive jason data from it and parse it later.  I am trying to access the api, through this code.  this doesn;t return me any data.  But curl on that api from another linux box returns me data, where i am i wrong here, please help me to understand this better as i am new to api concept.  The code i am using is

public class testCallouts{
// Pass in the endpoint to be used using the string url
  public String getContent(String url) {
// Instantiate a new http object
    Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setEndpoint(url);
    req.setMethod('GET');
// Send the request, and return a response
    HttpResponse res = h.send(req);
   return res.getBody();
   //return res.toString();
  }
testCallouts testCall = new testCallouts();
String ret=testCall.getContent('https://sandbox.example.com/api/v2/accounts?key=xxxxxxxxxxxx');
system.debug(ret);
}
ret returns null
  • April 23, 2014
  • Like
  • 0
Hi all,
I have access an external api, using api key to retreive jason data from it and parse it later.  I am trying to access the api, through this code.  this doesn;t return me any data.  But curl on that api from another linux box returns me data, where i am i wrong here, please help me to understand this better as i am new to api concept.  The code i am using is

public class testCallouts{
// Pass in the endpoint to be used using the string url
  public String getContent(String url) {
// Instantiate a new http object
    Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setEndpoint(url);
    req.setMethod('GET');
// Send the request, and return a response
    HttpResponse res = h.send(req);
   return res.getBody();
   //return res.toString();
  }
testCallouts testCall = new testCallouts();
String ret=testCall.getContent('https://sandbox.example.com/api/v2/accounts?key=xxxxxxxxxxxx');
system.debug(ret);
}
ret returns null
  • April 23, 2014
  • Like
  • 0

 

 

Hi,

 

I have two custom object Job and Task.
They are having master detail relationship where Job(Master) --> Task(Child)

Each Job must contain multiple Tasks.

For e.g. Job Name: Prining Books

 

Task
        Task Name: Task 1
        Task Name : Task 2
       
It should not allow another record with student name as 'Task 1', because it is already available under Job.

But Task Name "Task 1" can be allowed to add under different Job (say under Job Design Graphics), simply because here Task 1 is belongs to different Job.

How to resolve this problem?

Thanks,
Devendra S