We are now verified! Husqy is now a verified bot in Discord making us visible in the app discovery and enabling bigger trust to users!
Want to help us translate the Husqy responses? We can't do it without you! Please visit our translations repo!
Skip to main content

Husqy API Giveaways

General

Endpoints related to general Husqy Functions Giveaway functionality.

GET - /functions/giveaways/

Home endpoint for the Giveaway Husqy API. Returns only success message displaying that it is the Function Giveaways Husqy API route.

Entries

Endpoints related to entry functionality.

DELETE - /functions/giveaways/delete

Deletes all known giveaways for a specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to remove the giveaways from

Possible errors:

  • BadRequestError
GET - /functions/giveaways/entries

Returns a list of giveaway entries for the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the giveaway entries from
pagenointegerThe page number to get (default = 1)
page_sizenointegerThe amount of entries to return in one page (default = 10)

Possible errors:

  • BadRequestError
  • SettingsError
  • DatabaseError
  • InternalServerError
POST - /functions/giveaways/entries

Endpoint to create a new giveaway entry in a guild for a member.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to create the giveaway in
channel_idyesinteger(May be None) The ID of the channel where the /giveaway create command is send
message_idyesinteger(May be None) The ID of the message created by the /giveaway create command
giveaway_owner_idyesintegerThe ID of the owner of the giveaway
giveaway_channel_idyesintegerThe ID of the channel where the giveaway will take place
delayyesstringThe delay before the giveaway is ended and a winner is picked
prizeyesstringThe price of the giveaway
descriptionyesstring(May be None) The description of the giveaway
winner_countyesintegerThe amount of winner for the giveaway

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
GET - /functions/giveaways/entry/{giveaway_id}

Returns the details of the specified giveaway in the specified guild.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the specified giveaway entry details from

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
DELETE - /functions/giveaways/entry/{giveaway_id}

Deletes the specified giveaway from the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to delete the specified giveaways entry from
channel_idyesinteger(May be None) The ID of the channel where the /giveaway delete command is send
message_idyesinteger(May be None) The ID of the message created by the /giveaway delete command

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
PATCH - /functions/giveaways/entry/{giveaway_id}

Deletes the specified giveaway in the specified guild.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway to reroll is located
channel_idyesinteger(May be None) The ID of the channel where the /giveaway reroll command is send
message_idyesinteger(May be None) The ID of the message created by the /giveaway reroll command

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
POST - /functions/giveaways/entry/enter-giveaway
danger

Do not use this endpoint yourself! Please react to the giveaway in the Discord channel to enter a giveaway.

Endpoint to register the entering of a giveaway.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
channel_idyesintegerThe ID of the channel where the giveaway is located
message_idyesintegerThe ID of the message of the giveaway

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},
POST - /functions/giveaways/entry/leave-giveaway
danger

Do not use this endpoint yourself! Please remove your reation from the giveaway in the Discord channel to leave a giveaway.

Endpoint to register the leaving of a giveaway.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
message_idyesintegerThe ID of the message of the giveaway

Possible errors:

  • BadRequestError
  • SettingsError
  • InternalServerError
  • Unprocessable Entity
{
"success": False,
"data": {},
"error": {
"code": 422,
"message": "Unprocessable Entity! {reason}",
},
},

Giveaway handler

Endpoints related to entry handling functionality.

POST - /functions/giveaways/handler/create
danger

Do not use this endpoint yourself! Please use the POST - /functions/giveaways/entries to create a new giveaway.

Endpoint to add the giveaway to the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway
channel_idyesintegerThe ID of channel where the giveaway is located
message_idyesintegerThe ID of the message of the giveaway
end_timeyesintegerThe time when the giveaway will end
delete_atyesintegerThe time when the giveaway will be permanently deleted from the database
winneryesinteger(May be None) The winners of the giveaway
prizeyesintegerThe prize of the giveaway
descriptionyesinteger(May be None) The description of the giveaway
winner_countyesintegerThe amount of winners to choose when the giveaway has ended
participantsyesinteger(May be None) The current participants of the giveaway. This is a comma seperated list of user ID's
owner_idyesintegerThe ID of the owner of the giveaway
languageyesintegerThe language of the guild where the giveaway is located
auto_deleteyesintegerThe auto delete of the guild where the giveaway is located
winner_message_idyesintegerThe ID of the message where the winners have been announced

Possible errors:

  • BadRequestError
DELETE - /functions/giveaways/handler/delete
danger

Do not use this endpoint yourself! Please use the DELETE - /functions/giveaways/entry/{giveaway_id} to delete giveaway.

Endpoint to delete the giveaway from the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway to delete

Possible errors:

  • BadRequestError
PATCH - /functions/giveaways/handler/reroll
danger

Do not use this endpoint yourself! Please use the PATCH - /functions/giveaways/entry/{giveaway_id} to reroll a giveaway.

Endpoint to reroll the giveaway in the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway to reroll

Possible errors:

  • BadRequestError
PUT - /functions/giveaways/handler/enter-giveaway
danger

Do not use this endpoint yourself! Please use the POST - /functions/giveaways/entry/enter-giveaway to enter a giveaway.

Endpoint to enter the giveaway in the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway to enter

Possible errors:

  • BadRequestError
PUT - /functions/giveaways/handler/leave-giveaway
danger

Do not use this endpoint yourself! Please use the POST - /functions/giveaways/entry/leave-giveaway to leave a giveaway.

Endpoint to leave the giveaway in the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway to leave

Possible errors:

  • BadRequestError
PUT - /functions/giveaways/handler/edit
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy to edit giveaways.

Endpoint to leave the giveaway in the giveaways entries service.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the giveaway is located
giveaway_idyesintegerThe ID of the giveaway to edit
new_prizenostringThe new prize
new_descriptionnostringThe new description
new_winnersnostringThe new winners

Possible errors:

  • BadRequestError

Privacy

Endpoints related to privacy and giveaways

GET - /functions/giveaways/privacy/get-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to get the amount of references in giveaways to your user.

Query string parameters:

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild to get the specified giveaway entry details from
privacy_member_idyesintegerThe ID of the member who wants to check their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError
DELETE - /functions/giveaways/privacy/delete-user-entries
danger

Do not use this endpoint yourself! This endpoint will be used by Husqy's Privacy configurator (/privacy) command.

Endpoint to remove the references in giveaways to your user.

Body data (JSON):

fieldrequiredtypedescription
guild_idyesintegerThe ID of the guild where the references are located
privacy_member_idyesintegerThe ID of the member who wants to remove their references

Possible errors:

  • BadRequestError
  • ForbiddenError
  • InternalServerError