How to get modified records from the Schedules,Jobs,Quotes 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.
-
- Posts: 35
- Joined: Fri Jul 13, 2018 5:50 am
How to get modified records from the Schedules,Jobs,Quotes etc?
Hi
On daily basis I want to retrieve all the new records inserted OR all the records that are modified into the Schedules,Jobs,Quotes etc.
I want to retrieve it on daily basis.
Thanks in Advance!
jigar
On daily basis I want to retrieve all the new records inserted OR all the records that are modified into the Schedules,Jobs,Quotes etc.
I want to retrieve it on daily basis.
Thanks in Advance!
jigar
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi jiga,
Please look into If-Modified-Since Header usage:
http://developer.simprogroup.com/apidoc ... -resources
Please note that not all the endpoints/resouces support this header, we are adding them slowly.
cheers,
Rick
Please look into If-Modified-Since Header usage:
http://developer.simprogroup.com/apidoc ... -resources
Please note that not all the endpoints/resouces support this header, we are adding them slowly.
cheers,
Rick
Rick Lan
API Developer | simPRO Software Group
API Developer | simPRO Software Group
-
- Posts: 35
- Joined: Fri Jul 13, 2018 5:50 am
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi Rick,
Thanks for your assistance!
I have gone through the RestAPI link that you have suggested but I could not get any information related to latest modified data, My rest call status is "200 OK" but still I could not get the exact information what I'm trying to get!
I have make the rest call through the following RestAPI
/api/v1.0/companies/123/jobs/ If-Modified-Since: Wed, 30 May 2018 12:00:00 GMT
Thanks,
jigar
Thanks for your assistance!
I have gone through the RestAPI link that you have suggested but I could not get any information related to latest modified data, My rest call status is "200 OK" but still I could not get the exact information what I'm trying to get!
I have make the rest call through the following RestAPI
/api/v1.0/companies/123/jobs/ If-Modified-Since: Wed, 30 May 2018 12:00:00 GMT
Thanks,
jigar
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi jigar,
If-Modified-Since needs to put in the header:
https://developer.mozilla.org/en-US/doc ... fied-Since
cheers,
Rick
If-Modified-Since needs to put in the header:
https://developer.mozilla.org/en-US/doc ... fied-Since
cheers,
Rick
Rick Lan
API Developer | simPRO Software Group
API Developer | simPRO Software Group
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Can you give an example of inserting If-Modified-Since header in the GET request in PHP using simPRO API ?
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi Ashishs,
It depends on the framework you use, if you use Curl library in PHP, then the syntax is:
cheers,
It depends on the framework you use, if you use Curl library in PHP, then the syntax is:
Code: Select all
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("If-Modified-Since: ".gmdate('D, d M Y H:i:s \G\M\T',time())));
Rick Lan
API Developer | simPRO Software Group
API Developer | simPRO Software Group
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi Rick,
Thanks for the reply. I was hoping if you could provide with working example with a bit more detail.
Thanks for the reply. I was hoping if you could provide with working example with a bit more detail.
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hi Ashishs,
A brief working example using guzzle http might look like as follows.
A brief working example using guzzle http might look like as follows.
Code: Select all
<?php
require 'vendor/autoload.php';
use \GuzzleHttp\Client;
$client = new Client([
'base_uri' => '{simPRO-build-URL}
]);
$headers = [
'Authorization' => 'Bearer secure-access-token',
'Accept' => 'application/json',
'If-Modified-Since' => 'Wed, 29 Apr 2020 01:10:00 GMT'
];
$response = $client->request(
'GET',
'/api/v1.0/companies/{companyID}/jobs/',
[
'headers' => $headers
]
);
print $response->getBody();
Muqeet
API Developer | simPRO Software Group
API Developer | simPRO Software Group
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Thanks Muqeet.
In my instance, I'm using something like:
I pass the $provider object around when I make the API call. e.g.
Where would I insert the If-Modified-Since header in my example ?
In my instance, I'm using something like:
Code: Select all
$provider = (new \simPRO\RestClient\OAuth2\APIKey())
->withBuildURL($buildURL)
->withToken($token)
;
Code: Select all
$myArray = $provider->fetchJSON($provider->fetchRequest($URL));
Re: How to get modified records from the Schedules,Jobs,Quotes etc?
Hey Ashishs,
simPRO rest client is not actively maintained. The last update was made two years ago. It's just an example code repository to show how users can connect to simPRO rest API through different authorization types.
With that rest client you won't be able to send any headers to Provider object. If you really want to stick with the rest client you should look into the possibility of extending the Provider class to accept headers and pass it with $options array.
simPRO rest client is not actively maintained. The last update was made two years ago. It's just an example code repository to show how users can connect to simPRO rest API through different authorization types.
With that rest client you won't be able to send any headers to Provider object. If you really want to stick with the rest client you should look into the possibility of extending the Provider class to accept headers and pass it with $options array.
Muqeet
API Developer | simPRO Software Group
API Developer | simPRO Software Group