Skip to content
TORNLIFE More

OC 2.0 API response

Started by Allenone [2033011] on in Bugs & Issues.

2 replies · 70 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
3
Discussion span
→
People posting
2
Likes on archived posts
4
Posts by staff, officers and moderators
2
Authority score
56 / 100
Historical score
43 / 100
Story score
42 / 100
Engagement score
48 / 100

Most-liked replies

Allenone [2033011]

This OC failed before the bomber got to the checkpoint which triggers the Shaped Charge consumption.

 

I reclaimed the unused item to allow it to be re-loaned to another member.

14:51:04 - 10/04/26 Allenone retrieved 1x Shaped Charge from Jrod

 

The API doesn't properly reflect that the item was saved/unused.

 

I propose that the "null" response for crime.slots.user.item_outcome is changed from "null" when an item is unused to the same format as other items which are "lost"/"used".

 

Example

"
"item_outcome": {
            "owned_by": "faction",
            "item_id": 1431,
            "item_uid": 18151256050,
            "outcome": "unused/saved"
          }

"

 

Current response schema only has values for "lost" and "used"

 

 

Relevant OC API response:

{
  "crime": {
    "id": 1482110,
    "previous_crime_id": null,
    "name": "Blast from the Past",
    "difficulty": 7,
    "status": "Failure",
    "created_at": 1775259071,
    "planning_at": 1775312850,
    "executed_at": 1775832485,
    "ready_at": 1775831250,
    "expired_at": 1775863871,
    "slots": [
      {
        "position": "Picklock",
        "position_info": {
          "id": "P1",
          "label": "Picklock #1",
          "number": 1
        },
        "position_id": "P1",
        "position_number": 1,
        "item_requirement": null,
        "user": {
          "outcome": "Failed",
          "id": 2698343,
          "joined_at": 1775312850,
          "progress": 100,
          "item_outcome": null
        },
        "checkpoint_pass_rate": 80
      },
      {
        "position": "Hacker",
        "position_info": {
          "id": "P2",
          "label": "Hacker",
          "number": 1
        },
        "position_id": "P2",
        "position_number": 1,
        "item_requirement": {
          "id": 103,
          "is_reusable": false,
          "is_available": true
        },
        "user": {
          "outcome": "Failed",
          "id": 376247,
          "joined_at": 1775381388,
          "progress": 100,
          "item_outcome": {
            "owned_by": "faction",
            "item_id": 103,
            "item_uid": 10335947348,
            "outcome": "used"
          }
        },
        "checkpoint_pass_rate": 84
      },
      {
        "position": "Engineer",
        "position_info": {
          "id": "P3",
          "label": "Engineer",
          "number": 1
        },
        "position_id": "P3",
        "position_number": 1,
        "item_requirement": {
          "id": 1431,
          "is_reusable": false,
          "is_available": true
        },
        "user": {
          "outcome": "Failed",
          "id": 1877910,
          "joined_at": 1775401652,
          "progress": 100,
          "item_outcome": {
            "owned_by": "faction",
            "item_id": 1431,
            "item_uid": 18151256050,
            "outcome": "used"
          }
        },
        "checkpoint_pass_rate": 80
      },
      {
        "position": "Bomber",
        "position_info": {
          "id": "P4",
          "label": "Bomber",
          "number": 1
        },
        "position_id": "P4",
        "position_number": 1,
        "item_requirement": {
          "id": 1430,
          "is_reusable": false,
          "is_available": true
        },
        "user": {
          "outcome": "Failed",
          "id": 1019019,
          "joined_at": 1775344557,
          "progress": 100,
          "item_outcome": null
        },
        "checkpoint_pass_rate": 85
      },
      {
        "position": "Muscle",
        "position_info": {
          "id": "P5",
          "label": "Muscle",
          "number": 1
        },
        "position_id": "P5",
        "position_number": 1,
        "item_requirement": {
          "id": 1429,
          "is_reusable": false,
          "is_available": true
        },
        "user": {
          "outcome": "Failed",
          "id": 3113104,
          "joined_at": 1775409743,
          "progress": 100,
          "item_outcome": {
            "owned_by": "user",
            "item_id": 1429,
            "item_uid": 18227556159,
            "outcome": "used"
          }
        },
        "checkpoint_pass_rate": 80
      },
      {
        "position": "Picklock",
        "position_info": {
          "id": "P6",
          "label": "Picklock #2",
          "number": 2
        },
        "position_id": "P6",
        "position_number": 2,
        "item_requirement": null,
        "user": {
          "outcome": "Failed",
          "id": 420408,
          "joined_at": 1775410177,
          "progress": 100,
          "item_outcome": null
        },
        "checkpoint_pass_rate": 84
      }
    ],
    "rewards": null
  }
}

splent [2088243] Admin Staff

Thanks for the report. 

It looks like this information is not recorded in the DB. I could set "outcome": "unused/saved", however it looks I wouldn't have this information available:

            "owned_by": "faction",
            "item_id": 1431,
            "item_uid": 18151256050,

 

So I passed this requirement to another developer, and I'll be able to add it to the API once he's done.

 

Thanks!

splent [2088243] Admin Staff

Hey 

I was finally able to add this to the API. The `item_outcome` can now also be 'unused'. When that happens, the 'owned_by" is automatically set to "user" unfortunately and "item_uid" is set to 0 as I'm lacking this information and I also don't want to introduce new "null" values in order to not break the schema.

 

Hopefully that will be sufficient though. If the item was not used, then it will remain in faction/user inventory anyways. 

 

Thanks!