API talk:2/guild/:id/log

From Guild Wars 2 Wiki
Jump to navigationJump to search

Draft of page for upcoming v2 guild event log API[edit]

{{API endpoint infobox
| endpoint = /v2/guild/:id/log
| version = 2
| release = 
| scope = guilds
}}
This resource returns information about events from the event log of a specified guild. The endpoint requires the scope <code>guilds</code>, and will only work if the API key is from the guild leader's account. '''Note that this endpoint is not active yet'''

== Response ==
The endpoint must be requested with <code>:id</code> replaced with a valid guild ID. The endpoint will return an array of objects, each describing a guild event log entry. Each object has the following properties:

* <code>id</code> (number) - The ID of the entry in the guild's log data. Guaranteed to be unique within a guild's log data (but not globally).
* <code>time</code> (string) - The time the log entry was made. (ISO-8601 standard.)
* <code>type</code> (string) - The type of log entry. Additional fields appear for different values of <code>type</code>.
** If <code>treasury</code>:
*** <code>item_id</code> (number) - The ID of the item deposited in the treasury.
*** <code>count</code> (number) - The number of <code>item_id</code> deposited in the treasury.
** If <code>motd</code>:
*** <code>motd</code> (string) - The MOTD that was set for the guild.
* <code>user</code> (string) - The account name of the user that performed the event.

== Example ==
 https://api.guildwars2.com/v2/guild/4BBB52AA-D768-4FC6-8EDE-C299F2822F0F/log

 [
   {
     "id": 1190,
     "time": "2015-12-10T23:58:49.106Z",
     "type": "treasury",
     "user": "Lawton Campbell.9413",
     "item_id": 24299,
     "count": 150
   },
   {
     "id": 1111,
     "time": "2015-12-10T23:52:01.099Z",
     "type": "motd",
     "user": "Lawton Campbell.9413",
     "motd": "FSFOSDFJS"
   }
 ]

The preceding unsigned comment was added by Nightlark (talkcontribs) at 06:30, 23 December 2015‎ (UTC).

Thanks, looks like Eearslya implemented something very similar. -Chieftain AlexUser Chieftain Alex sig.png 16:40, 23 December 2015 (UTC)
...Oh wow, I didn't even know this was here. Whoopsie. Eearslya (talk) 16:42, 23 December 2015 (UTC)

response 2016-03-01[edit]

Update for the response fields:

  • id (number) — An ID to uniquely identify the log entry within the scope of the guild. Not globally unique.
  • time (string) — ISO-8601 standard timestamp for when the log entry was created.
  • user (string, optional) — The account name of the guild member who generated this log entry.
  • type (string) — The type of log entry. Additional fields are given depending on the type. Possible values:
    • influence — Additional fields include:
      • activity (string) — Activity that generated influence for the guild. Possible values: daily_login, gifted
      • total_participants (number) — Number of members.
      • participants (array of strings) — An array of account names of participants. Strings may be null.
    • invited — A guild member has invited user to the guild. Additional fields include:
      • invited_by (string) — Account name of the guild member who invited user.
    • joined — Guild invitation has been accepted by user.
    • kick — A guild member has been removed from the guild roster. Additional fields include:
      • kicked_by (string, optional) — Account name of the guild member who kicked. Omission of this field indicates the member left the guild.
    • motduser has changed the guild's MOTD. Additional fields include:
      • motd (string) — The new MOTD.
    • rank_change — A guild member has changed the rank of user. Additional fields include:
      • changed_by (string) — Account name of the guild member who modified the rank of user.
      • old_rank (string) — The ID and name of the previous rank of user. See API:2/guild/:id/ranks.
      • new_rank (string) — The ID and name of the new rank of user.
    • treasuryuser has deposited an item into the guild treasury. Additional fields include:
      • item_id (number) — ID of the deposited item.
      • count (number) — Quantity of the deposited item.
    • upgrade — A guild upgrade was queued or deposited by user, or has finished processing completed. Additional fields include:
      • upgrade_id (number) — ID of the upgrade. See API:2/guild/upgrades.
      • action (string) — The action that generated this message. Possible values:
        • queued — The upgrade was added to the processing line by user, if the user field is present. The decoration (bought from guild vendors) was added to the storage, if user field is absent.
        • complete — The upgrade finished being processed in the PvE/WvW Processing Line.

--BryghtShadow (talk) 15:20, 29 February 2016 (UTC)

{{API endpoint infobox
| endpoint = /v2/guild/:id/log
| version = 2
| release = 2016-02-04
| scope = guilds
}}
This resource returns information about certain events in a guild's log. The endpoint requires the scope <code>guilds</code>, and will only work if the API key is from the guild leader's account.

== Parameters ==
The optional parameter <code>?since</code> can be added to a guild log query. The <code>since</code> parameter takes an event <code>id</code> value as a value. This will filter out all log entries not newer than the id given. Any events when an id is equal to, or less than ?since will be omitted. 

== Response ==
The endpoint must be requested with <code>:id</code> replaced with a valid guild ID. The endpoint will return an array of objects, each describing a log entry. The endpoint will return roughly the last 100 events of each type at max. Each object has the following properties:

* <code>id</code> (number) - An ID to uniquely identify the log entry within the scope of the guild. Not globally unique.
* <code>time</code> (string) - ISO-8601 standard timestamp for when the log entry was created.
* <code>user</code> (string) - The account name of the guild member who generated this log entry.
* <code>type</code> (string) - The type of log entry. Additional fields are given depending on the type. Possible values:
** <code>joined</code> - <code>user</code> has joined the guild
** <code>invited</code> - <code>user</code> has been invited to the guild. Additional fields include:
*** <code>invited_by</code> (string) - Account name of the guild member which invited the player.
** <code>kick</code> - <code>user</code> has been kicked from the guild. Additional fields include:
*** <code>kicked_by</code> (string) - Account name of the guild member which kicked the player.
** <code>rank_change</code> - Rank for <code>user</code> has been changed. Additional fields include:
*** <code>changed_by</code> (string) - Account name of the guild member which changed the player rank.
*** <code>old_rank</code> (string) - Old rank name.
*** <code>new_rank</code> (string) - New rank name.
** <code>invite_declined</code> - <code>user</code> invitation to the guild has been cancelled. Additional fields include:
*** <code>declined_by</code> (string) - Account name of the guild member which cancelled the invitation.
** <code>treasury</code> - A guild member has deposited an item into the guild's treasury. Additional fields include:
*** <code>item_id</code> (number) - The item ID that was deposited into the treasury.
*** <code>count</code> (number) - How many of the specified item was deposited.
** <code>stash</code> - - A guild member has deposited/withdrawn an item into the guild stash. Additional fields include:
*** <code>operation</code> (string) - Possible values:
**** <code>deposit</code>
**** <code>withdraw</code>
*** <code>item_id</code> (number) - The item ID that was deposited into the treasury.
*** <code>count</code> (number) - How many of the specified item was deposited.
*** <code>coins</code> (number) - How many coins (in copper) were deposited.
** <code>motd</code> - A guild member has changed the guild's MOTD. Additional fields include:
*** <code>motd</code> (string) - The new MOTD.
** <code>upgrade</code> - A guild member has interacted with a guild upgrade. Additional fields include:
*** <code>action</code> (string) - The type of interaction had. Possible values:
**** <code>queued</code>
**** <code>cancelled</code>
**** <code>completed</code> - Having this action will also generate a new <code>count</code> field indicating how many upgrades were added.
**** <code>sped_up</code>
*** <code>upgrade_id</code> (number) - The upgrade ID which was completed.
*** <code>recipe_id</code> (number)(optional) - May be added if the upgrade was created through a scribe station by a scribe.


== Example ==
 https://api.guildwars2.com/v2/guild/4BBB52AA-D768-4FC6-8EDE-C299F2822F0F/log

 [
   {
     "id": 1190,
     "time": "2015-12-10T23:58:49.106Z",
     "type": "treasury",
     "user": "Lawton Campbell.9413",
     "item_id": 24299,
     "count": 150
   },
   {
     "id": 1111,
     "time": "2015-12-10T23:52:01.099Z",
     "type": "motd",
     "user": "Lawton Campbell.9413",
     "motd": "FSFOSDFJS"
   }
   {
     "id": 1375,
     "time": "2016-02-16T01:08:07.538Z",
     "type": "invited",
     "user": "Lawton Campbell.9413",
     "invited_by": "Lawton Campbell.9413"
   }
   {
     "id": 1533,
     "time": "2016-03-04T18:54:02.785Z",
     "type": "stash",
     "user": "Lawton Campbell.9413",
     "operation": "deposit",
     "item_id": 0,
     "count": 0,
     "coins": 20000
   }
   {
     "id": 1286,
     "time": "2015-12-23T00:48:20.539Z",
     "type": "upgrade",
     "upgrade_id": 364,
     "action": "queued",
     "user": "Lawton Campbell.9413",
   }
 ]

  https://api.guildwars2.com/v2/guild/4BBB52AA-D768-4FC6-8EDE-C299F2822F0F/log?since=1285

  [
     {
       "id": 1286,
       "time": "2015-12-23T00:48:20.539Z",
       "type": "upgrade",
       "upgrade_id": 364,
       "action": "queued",
       "user": "Lawton Campbell.9413"
     },
     {
       "id": 1470,
       "time": "2016-12-19T20:36:03.000Z",
       "type": "upgrade",
       "recipe_id": 11856,
       "upgrade_id": 776,
       "count": 1,
       "action": "completed",
       "user": "Lawton Campbell.9413"
    },
    {
       "id": 1522,
       "time": "2016-12-19T20:48:11.000Z",
       "type": "upgrade",
       "upgrade_id": 78477,
       "count": 1,
       "action": "completed",
       "user": "Lawton Campbell.9413"
     }
  ]

The preceding unsigned comment was added by Keroak (talk) at 12:29, 5 October 2017 (UTC).

I'm not quite sure what this is about? Was the entire copy-paste just to show that you want
  ** invite_declined - user invitation to the guild has been cancelled. Additional fields include:
  *** declined_by (string) - Account name of the guild member which cancelled the invitation.
Removed from the page? If so care to explain why? I haven't seen any notice of this being removed from the API. -Darqam 13:20, 5 October 2017 (UTC)
The page is also missing the "influence" type from this comment. --sonicolasj.9534 (talk) 00:12, 5 October 2023 (UTC)

Invite declined property[edit]

Sorry. I'm pretty new in the wiki. I wanted to add the "invite_declined" property.

User key can be absent from response[edit]

The wiki does not mark this key as optional, but I've got it missing from some events in my response (see below), at least when type is upgrade and action is queued.

[
  {
    "type": "upgrade",
    "item_id": 79867,
    "count": 1,
    "action": "completed",
    "id": 36413,
    "time": "2020-09-07T12:53:51.000Z",
    "user": "XXX.YYY",
    "upgrade_id": 772
  },
  {
    "id": 36412,
    "time": "2020-09-07T12:53:51.000Z",
    "type": "upgrade",
    "upgrade_id": 772,
    "action": "queued"
  }
]

The preceding unsigned comment was added by Sonicolasj (talk) at 15:50, 7 September 2020‎ (UTC).

I have a question into the devs on the discord to find out if it's a bug or the way it should be. To me user on the queued make a lot more sense as its a user generated log entry vs completed that is system generated Discord Thread --Tiny Taimi (talk) 22:32, 11 September 2020 (UTC)
More notes posted in discord, I'm officially calling it a bug in the API, the TLDR of the discord posts is, there is another action that only shows up if the different user pushes the button in the Assemble Device then the person that made the item at the scribing station, also if you notice in your in game logs when the same person Assembles the item that Scribed it the log says " Queued <item name>" notice the space at the start the user should be there but its missing. here is the output from the API when 1 person makes an item vs 2 people
1 user
    {
        "type": "upgrade",
        "recipe_id": 10486,
        "action": "completed",
        "id": 147054,
        "time": "2020-09-07T04:51:41.000Z",
        "user": "User1.1234",
        "upgrade_id": 399,
        "count": 1
    },
    {
        "id": 147053,
        "time": "2020-09-07T04:51:41.000Z",
        "type": "upgrade",
        "upgrade_id": 399,
        "action": "queued"
    }
2 Users
    {
        "id": 140792,
        "time": "2020-09-11T23:52:35.000Z",
        "type": "upgrade",
        "upgrade_id": 74,
        "action": "complete"
    },
    {
        "id": 140788,
        "time": "2020-09-11T23:52:05.000Z",
        "type": "upgrade",
        "upgrade_id": 74,
        "action": "queued",
        "user": "User2.4321"
    },
    {
        "type": "upgrade",
        "recipe_id": 11159,
        "action": "completed",
        "id": 140769,
        "time": "2020-09-11T23:48:40.000Z",
        "user": "User1.1234",
        "upgrade_id": 74,
        "count": 1
    }
so my finding are
completed = Made at scribe station and deposited in to the Assembly Device
queued = Someone pressed the button in the Assembly Device
complete = Actually finished in the Assembly Device (but only shows up if it was someone other then the user that caused the completed entry)
new discord link to full findings and screenshots
1 user making things
2 users making things
New Discord thread

--Tiny Taimi (talk) 00:23, 12 September 2020 (UTC)