Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass alias through request api call for the "requested by:" field #2363

Closed
v0idp opened this issue Jun 29, 2018 · 16 comments
Closed

Pass alias through request api call for the "requested by:" field #2363

v0idp opened this issue Jun 29, 2018 · 16 comments

Comments

@v0idp
Copy link

v0idp commented Jun 29, 2018

As requested by TidusJar I'm posting it here.

It would be nice if it was possible to set the alias for "requested by" field for each request api call.
For example in discord I could pass the username of the user to the api call so it shows "requested by discord username " instead of "requested by api"

@tidusjar
Copy link
Member

tidusjar commented Jul 4, 2018

@v0idp Can you pass an additional header along with ApiKey e.g. UserName ?

Since that would be ideal, If it's supplied then the API call runs under that user, else it runs under the API user.

@v0idp
Copy link
Author

v0idp commented Jul 4, 2018

yes I can pass the username through the header.

tidusjar pushed a commit that referenced this issue Jul 4, 2018
…allows people to use the API and request as a certain user. #2363
@tidusjar
Copy link
Member

tidusjar commented Jul 4, 2018

Done in develop and docs updated https://github.com/tidusjar/Ombi/wiki/Api-Information

Just pass a valid username in as the "UserName" header and it will work.

@tidusjar tidusjar closed this as completed Jul 4, 2018
@v0idp
Copy link
Author

v0idp commented Jul 4, 2018

@tidusjar by valid username you mean a user which exists in the ombi userlist or can I just enter any string ?

@tidusjar
Copy link
Member

tidusjar commented Jul 4, 2018

It needs to be a valid ombi user (Any user in the User Management Page)

@v0idp
Copy link
Author

v0idp commented Jul 4, 2018

The question is how to link the discord users to the ombi users ?! Because in discord we can't tell which discord user is which ombi user.

@tidusjar
Copy link
Member

tidusjar commented Jul 4, 2018

There's not much I can do about that, even if I included the property in the request body it still would have needed to be a valid user.

Everything relies on being a real user (The APIKEY user is a real user, it's just hidden).

Unless you create the discord user in Ombi.

@v0idp
Copy link
Author

v0idp commented Jul 4, 2018

so there is no way to just visually show a different name on the requests ?

@tidusjar tidusjar reopened this Jul 4, 2018
@tidusjar
Copy link
Member

tidusjar commented Jul 4, 2018

I'll see what I can do.

@v0idp
Copy link
Author

v0idp commented Jul 4, 2018

otherwise make another row where the passed username is in without using the real username so it would be something like "Requested by API" and another row with "username: xxx" and if no username was passed the row will be hidden

@goldenpipes
Copy link
Contributor

could you use ombi's {UserPreference} Discord ID's?

@goldenpipes
Copy link
Contributor

have mellow search the ombi user for a matching {UserPreference} (DISCORD ID) and have it get that username?

@v0idp
Copy link
Author

v0idp commented Dec 4, 2018

Easiest way would be just passing the username from the discord bot to the api. the API just needs to support some kind of "nickname" in the header or body. so it can be used for everything and not just discord.

@tidusjar
Copy link
Member

tidusjar commented Dec 4, 2018

It already allows you to pass a header. But the username you pass needs to be in ombi. So yes. I need to be able to pass a nickname

@v0idp
Copy link
Author

v0idp commented Dec 10, 2018

I dont mind doing the request with the api, but I would like to pass it a nickname so it says an additional name to the api

@tidusjar
Copy link
Member

This has now been done.

You can pass in a ApiAlias header and that will now show whatever string you pass in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants