These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Swagger config for Citadel API

Author
salacious necrosis
Garoun Investment Bank
Gallente Federation
#1 - 2016-10-06 00:32:08 UTC
Hello 3rd party devs!

I wrote a simple Swagger (http://swagger.io) spec file for the Citadel API that was announced previously. You can find my spec here. To reference the spec in a Swagger client generator you need to use the raw link which is: https://raw.githubusercontent.com/OrbitalEnterprises/swagger-specs/master/citadel-api.yaml

The Citadel API site doesn't allow cross-origin calls at the moment, so you can't use the raw link in the usual Swagger editor or UI. However, here's an example of how to use the spec from python using the bravado client generator:


# Bravado is a Swagger client generator from Yelp
from bravado.client import SwaggerClient

# Create a Swagger client for the Citadel API
testClient = SwaggerClient.from_url("https://raw.githubusercontent.com/OrbitalEnterprises/swagger-specs/master/citadel-api.yaml",
                                    config={'use_models': False, 'validate_responses': False})

# Get info about one citadel
testClient.Citadel.getCitadel(citadel_id=1021696460797).result()

# Get info about all citadels
testClient.Citadel.getAllCitadels().result()


A result will look like this:


{
  '1021696460797': {
    'firstSeen': datetime.datetime(2016, 8, 14, 23, 33, 52, tzinfo=tzutc()),
    'lastSeen': datetime.datetime(2016, 10, 6, 0, 11, 16, tzinfo=tzutc()),
    'name': 'Sarum Prime - Star Emporium',
    'regionId': 10000043,
    'regionName': 'Domain',
    'systemId': 30003522,
    'systemName': 'Sarum Prime',
    'typeId': 35833,
    'typeName': 'Fortizar'
  }
}


Happy coding!

Use EveKit ! - Tools for EVE Online 3rd party development

Messenger Of Truth
Butlerian Crusade
#2 - 2016-10-08 15:43:54 UTC  |  Edited by: Messenger Of Truth
I've started serving the CORS headers on the API now. Thanks for making this swagger definition, as I can now boast that the API has swagger.

Trade Hub Price Checker: stop.hammerti.me.uk/pricecheck

Visit "Haulers Channel" in game for all matters courier-related.

Structure name/system API: stop.hammerti.me.uk/api

salacious necrosis
Garoun Investment Bank
Gallente Federation
#3 - 2016-10-08 15:58:43 UTC
Awesome! Verified things work as expected. Here's the link for those who want to browse using the swagger UI: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/OrbitalEnterprises/swagger-specs/master/citadel-api.yaml

Use EveKit ! - Tools for EVE Online 3rd party development

Messenger Of Truth
Butlerian Crusade
#4 - 2016-11-11 11:28:27 UTC
I need to figure out how to update this swagger spec!

CCP's new ESI structure stuff provides much of the info hammerti.me.uk was set up to provide, but CCP's stuff doesn't give you info about structures you can't dock at, so hammerti.me.uk needs to continue, so that people with assets/wallet transactions/courier contracts that involve undockable citadels can still get good results from their tools.

Because of CCP's ESI stuff, I'm now able to provide a "public" field on the API results which reflects whether the station has public access, and for stations that have at some point been public I'm able to provide x/y/z locations in space via the API as well.

Trade Hub Price Checker: stop.hammerti.me.uk/pricecheck

Visit "Haulers Channel" in game for all matters courier-related.

Structure name/system API: stop.hammerti.me.uk/api

Spyke Austrene
Monitor - Understanding the Market
MARABUNTA
#5 - 2017-01-01 21:36:12 UTC  |  Edited by: Spyke Austrene
salacious necrosis wrote:
Awesome! Verified things work as expected. Here's the link for those who want to browse using the swagger UI: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/OrbitalEnterprises/swagger-specs/master/citadel-api.yaml


Good Evening.

First, i want to thank you for that very useful endpoint.
Thanks!

It would be even cooler and swaggier if it would be more generic, for example by changing the scheme off citadel/all to:


{
items:[
{
"citadelId": 1021033349135,
"typeId": 35832,
"name": "Kino - Eisberg",
"regionId": 10000016,
"location": {
  "y": 25486260557,
  "x": 1234281493996,
  "z": 3623392807498
  },
  "...":...
},
{...}
]
}



This would be awesome for ppl like me, who are writing .NET Wrappers for that.

But even the way it is now, it's really helpful. Thanks!!

SPYKE
Spyke Austrene
Monitor - Understanding the Market
MARABUNTA
#6 - 2017-01-02 11:52:46 UTC
Messenger Of Truth wrote:
I need to figure out how to update this swagger spec!

CCP's new ESI structure stuff ...


Could you provide a link for that please?

thanks.

SPYKE
salacious necrosis
Garoun Investment Bank
Gallente Federation
#7 - 2017-01-02 23:10:56 UTC
Spyke Austrene wrote:
Messenger Of Truth wrote:
I need to figure out how to update this swagger spec!

CCP's new ESI structure stuff ...


Could you provide a link for that please?

thanks.

SPYKE


That would be here: https://esi.tech.ccp.is/latest/

I'm still looking into your other question. Note that I don't control the endpoint described by the spec, I just wrote the spec so that you can generate a swagger client easily.

Use EveKit ! - Tools for EVE Online 3rd party development

Spyke Austrene
Monitor - Understanding the Market
MARABUNTA
#8 - 2017-01-24 17:17:41 UTC
salacious necrosis wrote:
Spyke Austrene wrote:
Messenger Of Truth wrote:
I need to figure out how to update this swagger spec!

CCP's new ESI structure stuff ...


Could you provide a link for that please?

thanks.

SPYKE


That would be here: https://esi.tech.ccp.is/latest/

I'm still looking into your other question. Note that I don't control the endpoint described by the spec, I just wrote the spec so that you can generate a swagger client easily.


Thanks.
Messenger Of Truth
Butlerian Crusade
#9 - 2017-01-26 11:25:46 UTC
Spyke Austrene wrote:
salacious necrosis wrote:
Awesome! Verified things work as expected. Here's the link for those who want to browse using the swagger UI: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/OrbitalEnterprises/swagger-specs/master/citadel-api.yaml


Good Evening.

First, i want to thank you for that very useful endpoint.
Thanks!

It would be even cooler and swaggier if it would be more generic, for example by changing the scheme off citadel/all to:


{
items:[
{
"citadelId": 1021033349135,
"typeId": 35832,
"name": "Kino - Eisberg",
"regionId": 10000016,
"location": {
  "y": 25486260557,
  "x": 1234281493996,
  "z": 3623392807498
  },
  "...":...
},
{...}
]
}



This would be awesome for ppl like me, who are writing .NET Wrappers for that.

But even the way it is now, it's really helpful. Thanks!!

SPYKE



Can you explain the benefits of your proposal over the existing mechanism? Specifically, I don't see why that would make citadel/all more generic. What exactly do you mean by generic here?

Trade Hub Price Checker: stop.hammerti.me.uk/pricecheck

Visit "Haulers Channel" in game for all matters courier-related.

Structure name/system API: stop.hammerti.me.uk/api