Below is the service i need to call
public class JobDraftService : BaseAPIService, IJobDraftService
{
public JobDraftService() : base() { }
public JobDraftService(SerializationInfo Info, StreamingContext Context) : base(Info, Context) { }
[TargetPool(PoolType.CBSvc, UseFormElements = false, UseNeoData = false, UseSession = false)]
public virtual JPResponse GetJobDraft(INeo neo, string jobDraftDid)
{
var response = new JPResponse();
JobDraftRepository jobDraftRepo = new JobDraftRepository();
var jobDraft = jobDraftRepo.LoadSingleJobDraft(neo as Neo, jobDraftDid);
response.Results.Add(jobDraft.JobDetails);
response.Results.Add(jobDraftDid);
response.Results.Add(jobDraft.JobDesc ?? "");
response.Results.Add(jobDraft.JobReq ?? "");
return response;
}
now by using that service i should create a api,which is like the below one..
[JWTAuthorizationFilter("/corporate/jobposterapi")]
public class JobDraftsController : BaseAuthorizationController
{
public string Get(string id)
{
try
{
var jobDraftService = RemoteCallRunner.MakeRemoteProxy();
return JsonConvert.SerializeObject(jobDraftService.GetJobDraft(MyCBNeo, id));
}
catch
{
Response.StatusCode = 500;
return JsonConvert.SerializeObject("An unknown error occurred while attempting to make your request.");
}
}
here i want to pass an URL as response.. so how can i pass an URL in API..
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaimin ShethiyaPosted Oct 18, 2019, 7:25 AM
Can you please used below code and check it's worked or not for query.
let me know if you have any other help needed.
Thanks