JSON REST API Data Fetch Object - JasXSL/GoThongs GitHub Wiki

A data fetch object is an object specifying which data you want returned in a call with the endpoint identifier GetAssetData.

The object has the syntax of

{
  fieldName : '',
  relationalFieldName : {
    relationalFieldFieldNameOne : '',
    relationalFieldFieldNameTwo : ''
  }
}

Provided the field supports relations, an object will add the field as a relation and include the relations objects into the 'included' array of the call. This means you can nest fields to get additional data.

If the field data is not an object, it will be returned as an attribute.

Example request:

{'tasks':[{
  'type' : 'GetAssetData',
  'target' : 'cf2625ff-b1e9-4478-8e6b-b954abde056b',
  'data' : {
    'type' : 'user',
    'data' : {
      'gold' : '',
      'active_thong' : {
        'level' : '',
        'thong' : {
          'name' : ''
        }
      }
    }
  }
}]}

This call would fetch a single user object (still wrapped in an array for SL simplicity) for Jasdac Stockholm. The object would contain the attribute "gold" with his current gold, as well as a related linkage object to active_thong. The active thong resource would end up in the 'included' array for the call and contain the level of Jasdac's currently active thong as an attribute. The active thong resource would also link to a thong resource. The thong resource will have the name of the thong class.

Restrictions

The entry point is restricted depending on its type:

  • User/User asset such as thongs owned by a user: The target user having your mod enabled.
  • Generic assets such as a class or spell: The asset being either official or part of your mod.

Any related objects are not limited, including party user data and thongs in inventory added by other mods.

Supported Types & Fields

Please see Data Fetch Fields

⚠️ **GitHub.com Fallback** ⚠️