Sign in to participate
Be Kind, Be Helpful
Ask a question, answer a question, and get to know the fine people in the Harvest community.
New objects don't have a useful value for updated_at
I’ve been mucking about with the api over the last couple of weeks and just wanted to check that
the issue I’m seeing is a system limitation and not something I’m doing wrong.
When I create a Client through the API the create_at attribute gets set, but the updated_at attribute
defaults to a date in 2009.
So for example if I create the Client;
https://XXXX.harvestapp.com/clients
<?xml version=“1.0” encoding=“UTF-8” standalone=“yes”?>
Tyler Allen
12 Wressle Road
PLAS LLYSYN
201-Created
But if I attempt to retrieve it with “updated_since” – nothing comes back.
https://XXXXX.harvestapp.com/clients?updated_since=2011-04-02+00%3A26%3A29
<?xml version=“1.0” encoding=“UTF-8”?>
If I query for all clients I can see the created client but the updated_at date is some date in 2009.
Tyler Allen 2011-04-02T00:26:32Z<!-- seems ok, but can't be queried -->
12 Wressle Road
PLAS LLYSYN
2009-12-10T11:03:15Z <!-- 2009 --->
530029
0
New Zealand Dollars – NZD
true
$
It sort of make sense, the client was created and not updated, but it’s making life hard to efficiently
filter the search results. I’ve tried following;
1. Attempted to set the “updated_at” attribute when it was created
2. Attempted to query by “created_at”
3. Attempted to query by “created_since”
The only thing that works is;
4. Query for all clients and then filter on either the created date or the updated date manually in my code.
Is there anything that I’m missing or is this just how things work in the current release?
Ack – forum didn’t like the XML. Is there anyway to format XML? I can repost the orignal text, as I have it saved locally.
Apparently we can use Textile helpers
Based on that, you should be able to wrap the XML in
blocks to ‘protect’ it:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <client> <name>Tyler Allen</name> <details>12 Wressle Road PLAS LLYSYN</details> </client>
Yea, I’m sorry, but Textile is rubbish.
If I even use the string p r e (sans spaces) it puts a block in…
pre
this content should not be inside this block
Harvest folks – if you insist on having Textile to let us format content, then please please please for the love of The Flying Spaghetti Monster give us the ability to preview our forum posts (or let us delete or edit them).
rperfect, that shouldn’t have been so! I have updated Harvest so updated_at will behave more sensibly. Unfortunately this won’t update any of the old records created prior. But all client records going forward should be kosher.
Thanks for letting us know about the problem!