diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index d079c6ad..61493600 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -364,6 +364,13 @@ groupRoleId: in: path schema: $ref: ./schemas/GroupRoleID.yaml +groupShortCodeAndDiscriminator: + name: groupShortCodeAndDiscriminator + description: Must be a valid group short code and discriminator. + required: true + in: path + schema: + $ref: ./schemas/GroupShortCodeAndDiscriminator.yaml hydrate: name: hydrate description: Populates some fields and changes types of others for certain objects. diff --git a/openapi/components/paths.yaml b/openapi/components/paths.yaml index 0972e92a..96eef05b 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -172,6 +172,8 @@ $ref: "./paths/files.yaml#/paths/~1gallery" /groups: $ref: "./paths/groups.yaml#/paths/~1groups" +/groups/redirect/{groupShortCodeAndDiscriminator}: + $ref: "./paths/groups.yaml#/paths/~1groups~1redirect~1{groupShortCodeAndDiscriminator}" /groups/roleTemplates: $ref: "./paths/groups.yaml#/paths/~1groups~1roleTemplates" "/groups/{groupId}": diff --git a/openapi/components/paths/groups.yaml b/openapi/components/paths/groups.yaml index cf8dd7a5..10c8c25b 100644 --- a/openapi/components/paths/groups.yaml +++ b/openapi/components/paths/groups.yaml @@ -63,6 +63,32 @@ paths: $ref: ../responses/groups/GroupResponse.yaml "401": $ref: ../responses/MissingCredentialsError.yaml + "/groups/redirect/{groupShortCodeAndDiscriminator}": + parameters: + - $ref: ../parameters.yaml#/groupShortCodeAndDiscriminator + get: + operationId: resolveGroupShortCodeAndDiscriminator + summary: Resolve Group Short Code and Discriminator + description: |- + Resolves a group short code and discriminator to a group ID. + + **Only works with the api.vrchat.cloud domain.** + + Other domains respond with a redirect to this endpoint on the api.vrchat.cloud domain. + (e.g., to https://api.vrchat.cloud/api/1/groups/redirect/VRCHAT.0000) + tags: + - groups + responses: + "302": + description: Redirect to the /home/group/{groupId} URL of the group. + headers: + Location: + description: The /home/group/{groupId} URL of the group. + schema: + type: string + example: /home/group/grp_7ccb6ca3-cd36-4dab-9ab1-7bcf08d794e4 + "404": + $ref: ../responses/groups/GroupNotFoundError.yaml /groups/roleTemplates: get: operationId: getGroupRoleTemplates diff --git a/openapi/components/schemas/GroupShortCodeAndDiscriminator.yaml b/openapi/components/schemas/GroupShortCodeAndDiscriminator.yaml new file mode 100644 index 00000000..2e8c543b --- /dev/null +++ b/openapi/components/schemas/GroupShortCodeAndDiscriminator.yaml @@ -0,0 +1,3 @@ +title: GroupShortCodeAndDiscriminator +type: string +example: VRCHAT.0000