Page 1 of 1

Update Job Data API response

Posted: Mon Oct 31, 2022 7:18 am
by demo
Hello,

I am using it to update the job data of any Job. The documentation says that he will provide only 2 types of responses from the API. I am getting 204 status when it updates the Job details of any Job. But I am not getting any type of error when he does not update Job details. So I think it's wrong. Because when API will not return any data or any response how will to manage it from my end?

Please give me the solution to this problem. Because I am stuck for a long time.

API: /api/v1.0/companies/{companyID}/jobs/{jobID}

Thank You

Re: Update Job Data API response

Posted: Mon Oct 31, 2022 10:58 pm
by robbertcha
Hi,

You can actually check the API status code from the response header, for example: 200 - Indicates that the request has succeeded, 401 - Unauthorized, but the responses will always comes with error message when its status code 4xx (client error) or 5xx (server error), so could you please send us the screenshot if possible, thank you.

HTTP Status Codes
https://restfulapi.net/http-status-codes/

Re: Update Job Data API response

Posted: Tue Nov 01, 2022 4:46 am
by demo
Ok, But how to get a specific error in response from your side?

If we get any specific reason then we can fix our problem, because sometimes notes are updating on Job, and sometimes same it's not updating. Then what are we understand what's an error here with the same notes that he does not update?
If we are getting only status with the API response then what did we understand for it?

Re: Update Job Data API response

Posted: Tue Nov 01, 2022 10:40 pm
by robbertcha
Hi,

Here is the way to grab API status code by using JS:-

Code: Select all

function makeRequest() {
  fetch('https://THISISURL.com/api/')
    .then(response => {
      console.log('response.status: ', response.status); 
      console.log(response);
    })
    .catch(err => {
      console.log(err);
    });
}

makeRequest();
Different programming has their own way to call APIs, but they always have responses and all the information are stored in this response, so please check on it. If the status code is 4xx, then it should be 'Client Error', and it always comes with a error message to explain why the request is not proceed successfully; if the status code is 5xx, then it is a "Server Error", and also it will have a message to remind users to contact our support.

So do you mind to provide us some screenshots about the job notes not being updating issue? because I just test it on our QA server, and everything is working as expected.

Re: Update Job Data API response

Posted: Wed Nov 02, 2022 4:40 am
by demo
Ok, I am already trying with cURL API. But I am not getting errors message and I am getting only status codes.

I am trying to update one other note as it is in the description box. So first, I create a note with HTML tags, and then it updates in the description column. Below I mentioned an example of notes

"<div style='font-size:10pt'><strong>auto-escalation process(10/31/2022)</strong>Open/Reviewed/On Hold invoice for review alert has been sent[SC]</div>"

This type of note is already being updated on other Jobs. So how to get the difference and how do we understood that here we will get 422 errors and another error? If it does not update on other Jobs then we can try to find the error and understand that error in the notes.

Here this type of note is already updated in the screenshot.

Re: Update Job Data API response

Posted: Thu Nov 03, 2022 12:16 am
by robbertcha
Hi,

This link might give you some idea about how to get the error message via cURL:-

https://stackoverflow.com/questions/392 ... -from-curl