Community
Showing results for 
Search instead for 
Do you mean 
Reply

Act! Essentials API - Server timestamp issue

New Member
Posts: 8
Country: Belgium

Act! Essentials API - Server timestamp issue

Hi,

During our tests with the Act! Essentials API we've noticed some issues with the returned timestamps. More specifically we are getting back impossible timestamps at some times.

Please see the below example whereby we are creating 4 contacts. When looking at the created attribute you can see that the first two were created at 15:21 (which was as expected considering the timestamp of the creations), but the last two were created at 15:12. This is impossible considering that the latter two would have an earlier timestamp than the ones created earlier.

$ curl -u :test "http://localhost:8003/contacts" -X POST -H "Content-Type: application/json" -d '{"data": { }}'
{
  "data":{
    "groups":null,
    "dynamicGroups":[],
    "socialProfiles":null,
    "id":"5919c76d301fa307c02bd4dc",
    "recordOwner":"donald-3@syncduck.com",
    "created":"2017-05-15T15:21:17Z"
  }
}
$ curl -u :test "http://localhost:8003/contacts" -X POST -H "Content-Type: application/json" -d '{"data": { }}'
{
  "data":{
    "groups":null,
    "dynamicGroups":[],
    "socialProfiles":null,
    "id":"5919c770301fa307c02bd4dd",
    "recordOwner":"donald-3@syncduck.com",
    "created":"2017-05-15T15:21:20Z"
  }
}
$ curl -u :test "http://localhost:8003/contacts" -X POST -H "Content-Type: application/json" -d '{"data": { }}'
{
  "data":{
    "groups":null,
    "dynamicGroups":[],
    "socialProfiles":null,
    "id":"5919c55e295c900768f6e4d3",
    "recordOwner":"donald-3@syncduck.com",
    "created":"2017-05-15T15:12:30Z"
  }
}
$ curl -u :test "http://localhost:8003/contacts" -X POST -H "Content-Type: application/json" -d '{"data": { }}'
{
  "data":{
    "groups":null,
    "dynamicGroups":[],
    "socialProfiles":null,
    "id":"5919c55f295c900768f6e4d4",
    "recordOwner":"donald-3@syncduck.com",
    "created":"2017-05-15T15:12:31Z"
  }
}

 

We can see the same behaviour when we are simply checking the response headers for identical requests:

bonias@ubuntu:~/dev/projects/piesync/connectors/act$ curl --insecure -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Mon, 15 May 2017 15:20:01 GMT
bonias@ubuntu:~/dev/projects/piesync/connectors/act$ curl --insecure -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Mon, 15 May 2017 15:28:53 GMT
bonias@ubuntu:~/dev/projects/piesync/connectors/act$ curl --insecure -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Mon, 15 May 2017 15:20:04 GMT
bonias@ubuntu:~/dev/projects/piesync/connectors/act$ curl --insecure -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Mon, 15 May 2017 15:20:04 GMT

 

Could you please find a way to resolve this? 

 

Thanks in advance.

Kind regards,

Wout

 

Employee
Posts: 236
Country: USA

Re: Act! Essentials API - Server timestamp issue

Hi,

 

The timestamps all look correct from the sample below.  We use MongoDB's native timestamp from object IDs, you can validate this yourself by pasting the IDs here: https://steveridout.github.io/mongo-object-time/,'

 

I can also see that that last 3 bytes in the IDs are incrementing in the first two transactions, and are complete different in the second two, which lines up with those transactions happening at a different time (per https://docs.mongodb.com/manual/reference/method/ObjectId/).

 

Is is possible you are looking at your logs of transactions what are indeed captured out of order and at different time? 

 

 

New Member
Posts: 3
Country: Poland

Re: Act! Essentials API - Server timestamp issue

[ Edited ]

Hi Xavier,

 

Those are no logs. Those are curl commands executed in the same time (within few seconds). Let me show you the same problem once again:

 

 

 

$ curl -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Thu, 01 Jun 2017 11:12:45 GMT
$ curl -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Thu, 01 Jun 2017 11:02:19 GMT
$ curl -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Thu, 01 Jun 2017 11:02:19 GMT
$ curl -s "https://mycloud.act.com/act/api/Contacts" -I | grep Date
Date: Thu, 01 Jun 2017 11:12:47 GMT

 

 

You can see 4 curl commands executed in the same time (within 2 seconds). But date returned by two of them differs vastly from two other (about 10 minutes).

 

And we can observe the exactly same problem when creating contacts. See:

 

 

$ curl -s -u apikey:developerkey "https://mycloud.act.com/act/api/Contacts" -X POST -H "Content-Type: application/json" -d '{"firstName":"Test"}'
{"firstName":"Test","groups":null,"dynamicGroups":[],"socialProfiles":null,"id":"592ff69d295c900e404e100d","recordOwner":"donald-3@syncduck.com","created":"2017-06-01T11:12:29Z"}

$ curl -s -u apikey:developerkey "https://mycloud.act.com/act/api/Contacts" -X POST -H "Content-Type: application/json" -d '{"firstName":"Test"}'
{"firstName":"Test","groups":null,"dynamicGroups":[],"socialProfiles":null,"id":"592ff912301fa30d54162d19","recordOwner":"donald-3@syncduck.com","created":"2017-06-01T11:22:58Z"}

$ curl -s -u apikey:developerkey "https://mycloud.act.com/act/api/Contacts" -X POST -H "Content-Type: application/json" -d '{"firstName":"Test"}'
{"firstName":"Test","groups":null,"dynamicGroups":[],"socialProfiles":null,"id":"592ff913301fa30d54162d1a","recordOwner":"donald-3@syncduck.com","created":"2017-06-01T11:22:59Z"}

$ curl -s -u apikey:developerkey "https://mycloud.act.com/act/api/Contacts" -X POST -H "Content-Type: application/json" -d '{"firstName":"Test"}'
{"firstName":"Test","groups":null,"dynamicGroups":[],"socialProfiles":null,"id":"592ff6a2295c900e404e100e","recordOwner":"donald-3@syncduck.com","created":"2017-06-01T11:12:34Z"}

 

 

Employee
Posts: 236
Country: USA

Re: Act! Essentials API - Server timestamp issue

Thanks for that, we're able to reproduce and looking into this.

 

Employee
Posts: 236
Country: USA

Re: Act! Essentials API - Server timestamp issue

Ok this should be resolved, thank you again for finding this.

New Member
Posts: 8
Country: Belgium

Re: Act! Essentials API - Server timestamp issue

Xavier,

 

The issue seems to be resolved indeed.

 

Thanks for the quick action
Kind regards,
Wout