freechat/docs/content/endpoints/invites.md
shockrah ba7b33ae62 Fixed broken links for messages endpoint description
 Should probably have a section for messages under structures
2021-03-04 13:21:09 -08:00

1.3 KiB

title anchor weight
Invites invites-ep 16

POST /invite/create

  • Required permissions:

    • CREATE_TMP_INVITES
      • Base requirement
    • CREATE_PERM_INVITES
      • Additional requirement for permanent invite codes
  • Required query string parameters:

    • id: u64
    • jwt: string
  • Returns

    • id: i64

    • uses: Optional This field is really meant for servers and really doesn't have much use to users. It just to keep track of whether or not an invite has been used too many times or not.

    • expires: boolean

Example

	> POST /invite/create?id=123&jwt=

	< { 
	<	"id": <unix-timestamp>, 
	<	"uses": 3, 
	<	"expires": true
	< }

GET /join

  • Required Permissions

    • None
  • Required query string parameters:

    • code: i64
  • Returns a new member account - The account details are not behind a key in the JSON object, so the resulting data is completely flat, for JSON.

    • id: u64
    • secret: String
    • name: String
    • joindate: i64
    • status: i32
    • permissions: u64
  • Default values

    • status: 0
    • permissions: 51
    • name: Anonymous
    • joindate: Current Unix time since epoch

Example

	> GET /join?code=123456

	< { 
	<	"id": 123,
	<	"secret": "super secret",
	<	"name": "Anonymous",
	<	"joindate": 134256,
	<	"status": 0,
	<	"permissions": 51
	< }