I have made successful calls to the api after oauth login but I'm getting an error when performing the following call:
https://www.bungie.net/platform/Destiny2/-1/Profile/14243036/?components=100
{"ErrorCode":18,"ThrottleSeconds":0,"ErrorStatus":"InvalidParameters","Message":"The input parameters were invalid, please enter valid input, and try again.","MessageData":{}}
I'm I missing something here?
Ah, yes! This is unfortunately a common problem. The problem here is:
You're passing -1 as the membership type, which is the "None" type. You'll have to pass the actual type you're looking for (Xbox = 1, PSN = 2, eventually Blizzard = 4). The Destiny endpoints can never return more than one Destiny Profile's information, and the profiles are per-platform so you have to specify the specific platform you want, and it has to match the membership ID you're passing in.
The membership ID you're passing is a Bungie.net membership ID instead of a Destiny Membership ID.
It's a bit complicated, but the Bungie.net membership ID is the ID specifically for your Bungie.net account. Each platform on which you play Destiny has its own membership ID, and you have to pass those membership IDs rather than the Bungie.net membership ID. You can use the Bungie.net membership ID to find the user's linked Destiny membership IDs by calling:
https://bungie-net.github.io/multi/operation_get_User-GetMembershipDataById.html#operation_get_User-GetMembershipDataById
Is -1 an acceptable membership type? From the sounds of the error it seems like one of the values you are passing is wrong. Is the membership ID from a specific platform or is that the bungie net membership ?
Thank you very much, using the correct membership id and passing the correct membership type worked. Those membership id's should be called something else to differentiate between the two.
Sweet, I'm glad it worked! Yeah, membership types are a pain in terms of the confusion that they cause in this regard. Internally, we tend to refer to them as "Destiny Memberships" and your "Bungie.Net Membership". The division used to be more clear in the GetBungieAccount service that used to be the gateway for accessing your memberships, but if you use which type is associated with the membership ID then it'll be easier to distinguish them. 254 is always a Bungie.Net membership ID, whereas any others are Destiny membership IDs.
Most helpful comment
Ah, yes! This is unfortunately a common problem. The problem here is:
You're passing -1 as the membership type, which is the "None" type. You'll have to pass the actual type you're looking for (Xbox = 1, PSN = 2, eventually Blizzard = 4). The Destiny endpoints can never return more than one Destiny Profile's information, and the profiles are per-platform so you have to specify the specific platform you want, and it has to match the membership ID you're passing in.
The membership ID you're passing is a Bungie.net membership ID instead of a Destiny Membership ID.
It's a bit complicated, but the Bungie.net membership ID is the ID specifically for your Bungie.net account. Each platform on which you play Destiny has its own membership ID, and you have to pass those membership IDs rather than the Bungie.net membership ID. You can use the Bungie.net membership ID to find the user's linked Destiny membership IDs by calling:
https://bungie-net.github.io/multi/operation_get_User-GetMembershipDataById.html#operation_get_User-GetMembershipDataById