What is wrong in here?

hi i am working on a discord bot that would get the battle tag after authorisation.
everything works fine with one client id that someone gave but i cant use and whith my client id the code that the api gives me is not right for that and i cant get the user bt.
the only thing i dont have in the client is a service url wich i have no clue what to put in so i checked the mark that i dont have any.
i have a felling that this is the place of the issue and if it is i have not clue what to put in.

You are probably trying to use the authorization_code as if it were an access_token.

You probably mean an access_token.

The client_id and client_secret are the pair of values you create here: API Access

To get an access_token you must implement one of the avaialble OAtuh2 flow.

If you need access to the user’s battletag and/or their game profiles (wow characters) you need to use the authorization_code flow described here.

You must create a sign in with bnet link that will redirect the user to the battle net login screen. After that an authorization_code will be returned to your app on the associated redirect_uri. After that you need to exchange your authorization_code to an access_token this is described on the second half of this doc.

Note: You need a redirect uri if you want to use this method. There is no way you can obtain an user’s access_token without this method.

i think you didnt understand it beacuse i discribed it wrong then i will try agian
someone gave me his client id (that you get here API Access). i dont what to use it beacuse i want to have my own but it gives me an invald battleNetCode and as soon as i change the the client id to what i got from a someone else its perfectly fine and working (BTW the lung is java)

You said:

You also said:

You need a valid redirect_uri. It is impossible for you to authorize any user without implementing the authorization_code flow. If you are only using the client_credentials flow you won’t have access to any user-specific battletag or profile.

the problem is not with the code its works fine with one client id but with my own it does not and i cant understand why

I’m not saying this is your code, but if you want help we will need more information.

Please, post here the exact error returned by battle net when you use your own credentials.