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.
 

How to make a request with scope: "characterMailRead" from ESI?

First post
Author
Vex Munda
Anti Enslavement Movement
#1 - 2016-11-16 09:56:16 UTC
Hey, here I am again xD,

I am having issues getting data with a scope from ESI.

I have the characterMailRead scope activated on: https://developers.eveonline.com/applications.

I am trying to use the following code to get some data from the server:

function mailInfoRequest(){
  var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange=function() {
    if (this.readyState == 4 && this.status == 200) {
    }
  }
  xhttp.open("GET", "https://esi.tech.ccp.is/dev/characters/" + characterID + "/mail/?datasource=tranquility", true);
  xhttp.setRequestHeader("Authorization", "Bearer " + access_token);
  xhttp.send();
}


I am getting the following response:

{"error": "token not valid for scope(s): esi-mail.read_mail.v1"}


The access token I am using is the same access_token as in this request (which is working):

function charInfoRequest(){
  var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange=function() {
    if (this.readyState == 4 && this.status == 200) {
    }
  }
  xhttp.open("GET", "https://login.eveonline.com/oauth/verify", true);
  xhttp.setRequestHeader("Authorization", "Bearer " + access_token);
  xhttp.send();
}


The response of this request, says it has succesfully gained the scope.


{"CharacterID":xxx,"CharacterName":"xxx","ExpiresOn":"xxx","Scopes":"characterMailRead","TokenType":"Character","CharacterOwnerHash":"xxx","IntellectualProperty":"EVE"}


Any idea what I am missing here?

Any help is appreciated. Thanks in advance.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2016-11-16 13:22:17 UTC
esi-mail.read_mail.v1 is the scope you need to request. (and have authorized on the developers site)

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Vex Munda
Anti Enslavement Movement
#3 - 2016-11-16 15:35:35 UTC
Steve Ronuken wrote:
esi-mail.read_mail.v1 is the scope you need to request. (and have authorized on the developers site)


esi-mail.read_mail.v1 does not exist on the developer site.

Should I also request the scope again (don't they know my scopes because of the authorization code)?
Blacksmoke16
Resilience.
#4 - 2016-11-16 15:48:51 UTC
In addition to what Steve said. characterMailRead scope is for the XML API . while the esi-mail.read_mail.v1 scope is for ESI. The latter scope is not released yet. So will have to use the XML API endpoint until it gets released. Documentation on how to do that is here:

http://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/authentication.html#sso-access-tokens

Vex Munda
Anti Enslavement Movement
#5 - 2016-11-16 16:33:54 UTC
Blacksmoke16 wrote:
In addition to what Steve said. characterMailRead scope is for the XML API . while the esi-mail.read_mail.v1 scope is for ESI. The latter scope is not released yet. So will have to use the XML API endpoint until it gets released. Documentation on how to do that is here:

http://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/authentication.html#sso-access-tokens



Thanks! This is exactly what I wanted to know!! Does CCP have a roadmap for the ESI API somewhere, since my website will rely on it.
Blacksmoke16
Resilience.
#6 - 2016-11-16 16:40:08 UTC
David Davaham
Deep Blue Logistics
#7 - 2016-11-17 05:57:08 UTC
There is the GitHub Project that you can follow

https://github.com/ccpgames/esi-issues/projects/1

Developer of EVEmail