Third Party Developer Blog

Oct
14

Read/Write of saved fits now on Sisi!

CCP FoxFour | 2015-10-14 13:20 | Comments

HOLY BATMAN IT'S HAPPENING! I think... assuming this testing goes well it will happen.

Right now you can go and create a CREST application for Sisi and request the scopes for fitting (characterFittingRead and characterFittingWrite). Upon requesting those scopes you can begin having people log into your site/application with those scopes at which point you should have authorization tokens that work for reading and writing saved fits. Here is how you go about using them.

If you follow CREST links from the root to the fittings resource you should go along the path of root -> decode -> character -> fittings.

Doing a GET on the character resource should get you results similar to the following:

{
  "totalCount_str": "1",
  "items": [
    {
      "description": "THIS IS A TEST FIT DESCRIPTION!",
      "fittingID_str": "258",
      "items": [
        {
          "flag": 11,
          "quantity_str": "1",
          "type": {
            "id_str": "518",
            "href": "http://crest.regner.dev/types/518/",
            "id": 518,
            "name": "Basic Gyrostabilizer"
          },
          "flag_str": "11",
          "quantity": 1
        }
      ],
      "fittingID": 258,
      "href": "http://crest.regner.dev/characters/90000001/fittings/258/",
      "ship": {
        "id_str": "587",
        "href": "http://crest.regner.dev/types/587/",
        "id": 587,
        "name": "Rifter"
      },
      "name": "THIS IS A TEST FIT NAME!"
    },
  ],
  "pageCount": 1,
  "pageCount_str": "1",
  "totalCount": 1
}

You can then do a POST to the fittings resource for that character that looks something like this to create a new fit:

{
  "name": "Name here...",
  "description": "Description here...",
  "items": [{
    "type": {
        "id": 518,
        "name": "Basic Gyrostabilizer",
        "href": "http://crest.regner.dev/types/518/"
    },
    "flag": 11,
    "quantity": 1
  }],
  "ship": {
    "id": 587,
    "name": "Rifter",
    "href": "http://crest.regner.dev/types/374/"
  }
}

You can then do a DELETE to a given fit resource to delete it. For a DELETE you don't need to send any data in the request, just do a DELETE request to the individual fit resource and you should be set.

The biggest disadvantage with this currently is that fits are cached for 15 minutes. So you could do a GET request but you won't see any changes from POST or DELETE requests for 15 minutes.

You can expect to get the following errors back from CREST:

  • FittingsStopSpamming
  • OwnerMaxFittings
  • FittingNameTooLong
  • FittingDescriptionTooLong

The fitting service has its own rate limit outside of the CREST rate limit and that can be hit easily if multiple applications are hitting the fitting resource, including the client.

Please let us know if you come across any issues with this feature. I would also like to request that you test this with the client open as you should see changes there instantly.

CCP FoxFour

back