Simple problem with logs API-call with "from=" | API…

Simple problem with logs API-call with "from="

    • Jubsu [2674033]
    • Role: Civilian
    • Level: 15
    • Posts: 4,980
    • Karma: 530
    • Last Action: 2 years
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 01:44:10 - 18/10/21 (2 years ago)
    |
    Last replied 08:22:50 - 05/01/22 (2 years ago)
    Hi.
    "From" doesn't work when I try to call API logs. I always get the last entries instead, just as without the "from".
    "To" works just fine, as far as I could tell.

    What's going on?



    Examples:
    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&to=1620000000&key=
    This works fine. I get a few logs up to the specified time

    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&from=1620000000&key=
    Doesn't work. I get the last log entries no matter what stamp I use. Only difference is "to" and "from".
    Can't make sense of this.
    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 100
    • Posts: 3,745
    • Karma: 5,371
    • Last Action: 1 minute
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 08:26:45 - 18/10/21 (2 years ago)
    Post link copied to clipboard Copy post link

    Jubsu [2674033]

    Hi.
    "From" doesn't work when I try to call API logs. I always get the last entries instead, just as without the "from".
    "To" works just fine, as far as I could tell.

    What's going on?



    Examples:
    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&to=1620000000&key=
    This works fine. I get a few logs up to the specified time

    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&from=1620000000&key=
    Doesn't work. I get the last log entries no matter what stamp I use. Only difference is "to" and "from".
    Can't make sense of this.
    "from" gets the last 100 calls between that timestamp and to (=now when absent). So if you got more than 100 logs since then, it will show the last 100 and you'll have to work your way back.
    • Jubsu [2674033]
    • Role: Civilian
    • Level: 15
    • Posts: 4,980
    • Karma: 530
    • Last Action: 2 years
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:08:02 - 18/10/21 (2 years ago)
    Post link copied to clipboard Copy post link

    Jubsu [2674033]

    Hi.
    "From" doesn't work when I try to call API logs. I always get the last entries instead, just as without the "from".
    "To" works just fine, as far as I could tell.

    What's going on?



    Examples:
    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&to=1620000000&key=
    This works fine. I get a few logs up to the specified time

    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&from=1620000000&key=
    Doesn't work. I get the last log entries no matter what stamp I use. Only difference is "to" and "from".
    Can't make sense of this.

    DeKleineKobini [2114440]

    "from" gets the last 100 calls between that timestamp and to (=now when absent). So if you got more than 100 logs since then, it will show the last 100 and you'll have to work your way back.
    Ah, I thought it works totally differently. Thank you for your reply.
    • Jubsu [2674033]
    • Role: Civilian
    • Level: 15
    • Posts: 4,980
    • Karma: 530
    • Last Action: 2 years
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:17:34 - 18/10/21 (2 years ago)
    Post link copied to clipboard Copy post link
    Here is my suggestion for the "From"-function, also it's how I thought it already works:

    API: Better "From"-function for logs | Suggestions |… (torn.com)
    • Tsume [195620]
    • Role: Civilian
    • Level: 100
    • Posts: 1,595
    • Karma: 1,651
    • Last Action: 21 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 08:16:44 - 05/01/22 (2 years ago)
    Post link copied to clipboard Copy post link

    Jubsu [2674033]

    Hi.
    "From" doesn't work when I try to call API logs. I always get the last entries instead, just as without the "from".
    "To" works just fine, as far as I could tell.

    What's going on?



    Examples:
    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&to=1620000000&key=
    This works fine. I get a few logs up to the specified time

    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&from=1620000000&key=
    Doesn't work. I get the last log entries no matter what stamp I use. Only difference is "to" and "from".
    Can't make sense of this.

    DeKleineKobini [2114440]

    "from" gets the last 100 calls between that timestamp and to (=now when absent). So if you got more than 100 logs since then, it will show the last 100 and you'll have to work your way back.
    Not really. I set From start of last year and it only shows latest data, ignoring "from" completely. A bit of a bummer.
    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 100
    • Posts: 3,745
    • Karma: 5,371
    • Last Action: 1 minute
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 08:22:50 - 05/01/22 (2 years ago)
    Post link copied to clipboard Copy post link

    Jubsu [2674033]

    Hi.
    "From" doesn't work when I try to call API logs. I always get the last entries instead, just as without the "from".
    "To" works just fine, as far as I could tell.

    What's going on?



    Examples:
    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&to=1620000000&key=
    This works fine. I get a few logs up to the specified time

    https://api.torn.com/user/?selections=log&log=1210,1211,1212,12210&from=1620000000&key=
    Doesn't work. I get the last log entries no matter what stamp I use. Only difference is "to" and "from".
    Can't make sense of this.

    DeKleineKobini [2114440]

    "from" gets the last 100 calls between that timestamp and to (=now when absent). So if you got more than 100 logs since then, it will show the last 100 and you'll have to work your way back.

    Tsume [195620]

    Not really. I set From start of last year and it only shows latest data, ignoring "from" completely. A bit of a bummer.
    That's exactly what I said? It gets the 100 last (=newest) rows between to (=now when absent) and from (=ignored when absent). You need to work from newest to oldest, not the other way around. There is a valid reason for it, but you'll have to take my word for it as I can't find the source and me being committee means I have to be careful with giving information.
    Last edited by DeKleineKobini on 08:23:09 - 05/01/22
Reply
Thread Title: