Update Job Data API response

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
demo
Posts: 17
Joined: Sat May 14, 2022 12:24 pm

Update Job Data API response

Post by demo » Mon Oct 31, 2022 7:18 am

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
robbertcha
Posts: 416
Joined: Thu Apr 15, 2021 10:07 pm

Re: Update Job Data API response

Post by robbertcha » Mon Oct 31, 2022 10:58 pm

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/
Robbert
API Developer | simPRO Software Group
demo
Posts: 17
Joined: Sat May 14, 2022 12:24 pm

Re: Update Job Data API response

Post by demo » Tue Nov 01, 2022 4:46 am

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?
robbertcha
Posts: 416
Joined: Thu Apr 15, 2021 10:07 pm

Re: Update Job Data API response

Post by robbertcha » Tue Nov 01, 2022 10:40 pm

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.
Robbert
API Developer | simPRO Software Group
demo
Posts: 17
Joined: Sat May 14, 2022 12:24 pm

Re: Update Job Data API response

Post by demo » Wed Nov 02, 2022 4:40 am

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.
Attachments
screenshot-nimbusweb.me-2022.11.02-10_08_52.png
screenshot-nimbusweb.me-2022.11.02-10_08_52.png (74.76 KiB) Viewed 19809 times
robbertcha
Posts: 416
Joined: Thu Apr 15, 2021 10:07 pm

Re: Update Job Data API response

Post by robbertcha » Thu Nov 03, 2022 12:16 am

Hi,

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

https://stackoverflow.com/questions/392 ... -from-curl
Robbert
API Developer | simPRO Software Group
Post Reply