AnsweredAssumed Answered

REST API expires_in regularity

Question asked by Takehiro Monday on Mar 16, 2016
Latest reply on Mar 18, 2016 by Kenny Elkington

Hi

 

In this month, I am making REST API 8000 calls per day.

Today I checked api logs, I found a few errors {"code":"601","message":"Access token invalid"} or {"code":"602","message":"Access token expired"}.

 

So I investigated Get Access Token /oauth/token API.

When I made 60 calls, only five expires_in are 3599 and the others are less than 100.

My Question

- Why is expires_in always 3599 or <100 always?

- Why is expires_in random rather than orderly?

 

Of course i know Marketo REST API Exception and Error Handling: Part 2 , but I think still strange.

I expect 3598, 3597 ...2000...1000...700...

I expect brand new token is always 3600.

 

2016/03/16 19:00:36 Expires_in=3599 token=8b23d8d9-a0a6-4f92-9196-8d611ddba5cb:sj

2016/03/16 19:00:37 Expires_in=4 token=2bbed36c-6ca1-4819-ac97-ef1f7446548f:sj

2016/03/16 19:00:39 Expires_in=2 token=2bbed36c-6ca1-4819-ac97-ef1f7446548f:sj

2016/03/16 19:00:40 Expires_in=1 token=2bbed36c-6ca1-4819-ac97-ef1f7446548f:sj

2016/03/16 19:00:42 Expires_in=3599 token=b5424c6d-4dc0-4a09-a48f-25370591a575:sj

2016/03/16 19:00:43 Expires_in=48 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:44 Expires_in=47 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:45 Expires_in=46 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:47 Expires_in=44 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:48 Expires_in=43 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:49 Expires_in=42 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:50 Expires_in=40 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:52 Expires_in=39 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:53 Expires_in=38 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:54 Expires_in=37 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:56 Expires_in=35 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:57 Expires_in=34 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:58 Expires_in=33 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:00:59 Expires_in=31 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:01 Expires_in=30 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:02 Expires_in=29 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:03 Expires_in=28 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:05 Expires_in=26 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:06 Expires_in=25 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:07 Expires_in=24 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:08 Expires_in=22 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:10 Expires_in=21 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:11 Expires_in=20 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:12 Expires_in=19 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:14 Expires_in=17 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:15 Expires_in=16 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:16 Expires_in=15 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:17 Expires_in=13 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:19 Expires_in=12 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:20 Expires_in=11 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:21 Expires_in=10 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:22 Expires_in=8 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:24 Expires_in=7 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:25 Expires_in=6 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:26 Expires_in=5 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:28 Expires_in=3 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:29 Expires_in=2 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:30 Expires_in=1 token=650090de-40ab-4c39-91b6-c6f995137ea1:sj

2016/03/16 19:01:31 Expires_in=3599 token=d996382c-8efa-4317-ba27-0e56a4e353be:sj

2016/03/16 19:01:33 Expires_in=3599 token=46e6cde2-9a32-40ce-971b-966f250b1aab:sj

2016/03/16 19:01:34 Expires_in=8 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:36 Expires_in=7 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:37 Expires_in=6 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:38 Expires_in=5 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:39 Expires_in=3 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:41 Expires_in=2 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:42 Expires_in=1 token=b5ff4a67-3fcd-42c4-8e5a-a76757005d75:sj

2016/03/16 19:01:43 Expires_in=3599 token=69721494-542b-405d-bc24-f5bf66e654cd:sj

2016/03/16 19:01:45 Expires_in=48 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:46 Expires_in=47 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:47 Expires_in=46 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:48 Expires_in=44 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:50 Expires_in=43 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:51 Expires_in=42 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

2016/03/16 19:01:52 Expires_in=40 token=ec03aec4-d51e-4518-9cbf-2cbd71569f53:sj

Outcomes