Inara API

More about Inara API is on the API page, general dev guidelines are here and more detailed documentation about the events and data format here.

Just a note for tool authors using Inara API - please ensure your apps are doing  TWO requests per minute AT MAXIMUM. As I have discovered, many users are using multiple apps at once (nothing wrong with that), but are also updating their profiles from all of the applications at once, which is causing quite serious overhead. For such reason, I have needed to make API requests limits much tighter. For bots and other similar non-demanding apps are requests rates set same as before. If do you need another requests rate limit, please send me a PM.

Inara API update for Odyssey:
  • The header property isDeveloped was renamed to less confusing isBeingDeveloped. You don't need to change anything on your end though, the old property will still work.
  • A new event addCommanderTravelLand for commanders landing on the celestial body was added (should be triggered at journal's Touchdown, DropShipDeploy and similar).
  • The events addCommanderTravelCarrierJump, addCommanderTravelDock, addCommanderTravelFSDJump and setCommanderTravelLocation now contain optional properties for the star system coordinates, celestial body and celestial body coordinates. It's not required to set, it may however help to further precise commander's location when the star system is not in the database, etc.
  • The events addCommanderTravelDock, addCommanderTravelFSDJump and addCommanderTravelLand are now having boolean properties isTaxiShuttle and isTaxiDropship for travelling with Apex or Frontline Solutions ships.
  • New events setCommanderInventory, resetCommanderInventory, setCommanderInventoryItem, addCommanderInventoryItem and delCommanderInventoryItem added. Those are supposed for handling the new Odyssey events like ShipLockerMaterials and similar, you can however use it also for the existing engineering materials or ship cargo instead of the existing dedicated events (but you do not need to, they are not going anywhere).
  • New events setCommanderSuitLoadout, updateCommanderSuitLoadout and delCommanderSuitLoadout for the suit loadouts added.
06 Nov 2017, 9:04am
"There is not possible to set empty Cargo and Materials at this moment, it is a bug which will be fixed ASAP"
Isn't it working with setCommanderCargoItem ? I'm setting the inventory on game startup and it seems to be working properly.
06 Nov 2017, 11:43am
Yes, it will work with setCommanderInventoryCargoItem, but as it is doing reset/set just for the individual item, to properly set the whole cargo/materials it requires that commodities/materials needs to be reset/set one by one, including rares and it is pretty long list that requires a lot of events sent and also app must hold the internal list of all commodities, rares and materials. So setCommanderInventoryCargo/setCommanderInventoryMaterials is a better way how to do it, as it also resets whole cargo/materials at once (in case the commander has nothing) just by sending the empty eventData in it (and there is the bug, currently).
06 Nov 2017, 4:26pm
Another update
There were new mission related events added, namely:
  • addCommanderMission
  • setCommanderMissionAbandoned
  • setCommanderMissionCompleted
  • setCommanderMissionFailed
  • addCommanderPermit

The bug with empty Cargo/Materials was fixed and there was also new optional parameter added for the cargo items (missionGameID) for the items tied directly to missions. Please note that there is currently no visible permits list on Inara, but you can implement the event in advance (permits list will be added to CMDR's profiles soon).
06 Nov 2017, 7:06pm
What happens if I try to send a null value to an optional parameter ? If I can get rid of those None checks...
06 Nov 2017, 7:11pm
It should be safe, but better to send just what needs to be sent.
06 Nov 2017, 10:41pm
Additional stuff added for the community goals:
  • getCommunityGoalsRecent
  • setCommanderCommunityGoalProgress
  • setCommunityGoal
Please note that 'setCommunityGoal' does nothing on live data at this moment, as all your apps are still set in development mode on server side. As this event directly affects public community goals data, I do not want to risk some mess with a test data. But, please, implement this event (also with 'setCommanderCommunityGoalProgress') as it benefits all users, I will check if everything is correct in the logs and I will let you know if there will be something wrong.


Last edit: 06 Nov 2017, 10:52pm
08 Nov 2017, 11:22pm
Combat log stuff added:
  • addCommanderCombatDeath
  • addCommanderCombatInterdicted
  • addCommanderCombatInterdiction
  • addCommanderCombatInterdictionEscape
  • addCommanderCombatKill

I expect that I will add ship/fleet related events by Friday and all journal import stuff should be covered then.
09 Nov 2017, 8:03pm
(Don't tell anyone the commanderName header is almost required now)
09 Nov 2017, 8:14pm
Yep, but as it is important rather just for the combat logs at this moment, I will lower this requirement eventually and just disable some stuff when the commander name is not provided.
09 Nov 2017, 10:06pm
Hi,

Thanks for making this API.

Not sure if this has already been brought up yet (searched for "role" on all the pages of this thread) but would it be possible to add role information (e.g. Explorer, Special Agent, etc.) to the getCommanderProfile API ?
09 Nov 2017, 10:10pm
Yes, it will be there. I know you mentioned it earlier, but I forgot to add it there.
09 Nov 2017, 10:20pm
Excellent
10 Nov 2017, 12:15am
So, another API update:
  • There was a change in header for 'commanderName'. It is not specifically required, unless you will want to use combatlog-oriented events. But it is recommend to set it even without that, when known from the journals/cAPI.
  • There were some improvements for the getCommanderProfile (how is search performed and for the output)
Few recommendations in case you didn't handled it already:
  • There is recommended to not set Dock on the session start (after the 'Location' event in the journal), as it may generate a ton of 'docked' events and mess commander's flight log (which may decrease their overall happiness ). There should be a proper 'dock' event already recorded from the previous session.
  • Don't forget to correctly remove/add cargo commodities or materials also on journal events like MiningRefined, ScientificResearch, SearchAndRescue, Synthesis, EngineerCraft, EngineerContribution, etc.

New ship/fleet related events were added:
  • addCommanderShip
  • delCommanderShip
  • setCommanderShip
  • setCommanderShipDock
It is just a few events, but it should cover everything required. Please take a look on Journal to JSON examples with a few tips how to properly implement it for the journal events.

At this moment, the API has everything that Inara journal import does. If there will be no errors, I would like to officially move Inara API out of the beta stage this Sunday afternoon. If do you would like and your apps will be properly tested and working as intended, feel free to release your apps sooner than that.

Of course, it doesn't mean that there won't be any additional events added to the API in the following days, near future or distant future, just that the important things for the commander's profiles and its updates are there already.
10 Nov 2017, 8:07pm
Minor change for interdiction events:
I did some internal 'polishing' pass and also fixed few inconsistencies in the documentation. There was one change for the combatlog events, though - the 'isPlayer' flag is now required for the interdiction events, to ensure it is really set and sender knows if it was NPC or player (and just didn't forgot to set it) as it is a critical information.
11 Nov 2017, 10:54am
MrSheepSheep can you confg.set(‘inara_out’, 0) in your plugin_start() and prefs_changed() if the user has enabled any of your output options, to ensure that data isn’t sent to Inara twice.

Post a reply

You must be signed in to post here.
Inara API is... well... see sticky post for the details.