Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

indreams.me API

James edited this page Oct 4, 2020 · 1 revision

This JSON API is used by the frontend of the official indreams.me website, and is available under https://indreams.me/api/. Luckily not all of the endpoints require PSN auth.

As far as I can infer (from error messages and the suchlike) this API is built with NodeJS, but interacts with an internal API that's potentially using GraphQL or something similar.

HMAC Auth Headers

These headers must be sent with every request, or the server will get very angry and spit an error at you:

Header Value
X-Auth Hash digest as a hex string
X-TS Current time in seconds

The hash is an sha-256 HMAC using the key gUkXp2s5v8y/B?E(H+MbQeThWmYq3t6w. It's calculated from the following data, in order:

  • The request body (only if the request method is POST)
  • The request path (not including the domain but including the query string)
  • The current time (in seconds, as a string)

JWT Auth

Some requests also require a JWT to be set via the AuthToken cookie. If you have the game, you can grab this cookie by signing into the indreams.me site and navigating to Application > Storage > Cookies > https://indreams.me in Google Chrome's devtools.

indreams.me JWTs use HMACSHA256 and seem to be valid for up to a week after they've been issued. The payload contains various details about the user including their accessToken, permissions, profile images, etc

Endpoints

The following methods are available with only HMAC auth headers:

Method Path
GET game/count/players
GET playlist
GET playlist/search
GET search
GET search/users
GET user/profile
GET user/creations
GET user/photos
GET user/streamed
GET user/followers
GET user/following/users
GET user/following/creations
GET creation/profile
GET creation/credits
GET creation/photos
GET creation/streamed-by
GET creation/genealogy
GET creation/usedin
GET creation/contents
GET creation/remixes
GET creation/followers
GET comment/search
GET photo/profile
GET text/locale

The following methods also require JWT auth:

Method Path
POST auth/presence/set
POST auth/accesstoken/update
GET user/id
GET user/edit
GET user/report
GET user/update
POST user/metadata/edit
POST user/hub/reset
POST user/role/switch
POST user/role/reset
POST user/follow/edit
POST user/like/edit
GET creation/edit
GET creation/live
GET creation/report
POST creation/metadata/edit
POST creation/icon/edit
POST creation/follow/edit
POST creation/like/edit
POST creation/playlater/edit
POST creation/collaborators/edit
POST creation/gallery/edit
GET comment/report
POST comment/add
POST comment/delete
POST comment/vote
GET photo/edit
GET photo/report
POST game/connection/ping
POST game/creation/launch
POST game/creation/sendToWand
POST game/keyboard/update
POST game/keyboard/close
GET events/user
POST events/user/timestamp/update
POST events/collaborator/accept
POST events/collaborator/reject
GET tags/search
POST grief/report/submit
POST audio/import

GET game/count/players

Returns the current number of users playing Dreams.

GET playlist

Returns the news feed, showcase playlists, etc shown on the indreams.me homepage.

GET playlist/search

Query param Optional Details
filter Yes TODO
sort Yes Values documented below
start Yes Pagination start offset, max is 999

sort values:

Value
Busiest
RecentlyAddedGraphEdge
MostLiked
MostPlayed
MostRecent
MostUsed
MostVotes
Recommended
ReleaseDate
Trending
User_Level
User_OnlineStatus

GET search

Query param Optional Details
term Yes Search term
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType + 'users'
sort Yes Values documented below

sort values:

Value
recommended
trending
releasedate
mostrecent
mostliked
mostplayed
mostused

GET search/users

Query param Optional Details
term Yes Search term
start Yes Pagination offset
sort Yes Values documented below
persona Yes Values documented below

sort values:

Value
recommended
trending
useronline
userlevel
mostliked

persona values:

Value
player
designer
artist
animator
audio
curator

GET user/id

Returns the IndreamsID for a given username. Requires JWT auth.

Query param Optional Details
onlineId No Username

GET user/profile

Returns the user's profile information.

Query param Optional Details
userId No User's indreamsID

GET user/creations

Returns a list of a user's creations.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType
sort Yes Values documented below

sort values:

Value
recommended
trending
releasedate
mostrecent
mostliked
mostplayed
mostused

GET user/photos

Returns a list of photos that a user has taken.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset

GET user/streamed

Returns a list of creations that a user has streamed.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType
sort Yes Values documented below

sort values:

Value
recommended
trending
releasedate
mostrecent
mostliked
mostplayed
mostused

GET user/followers

Returns a list of users that are following a user.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset
sort Yes Values documented below
persona Yes Values documented below

sort values:

Value
recommended
trending
useronline
userlevel
mostliked

persona values:

Value
player
designer
artist
animator
audio
curator

GET user/following/users

Returns a list of users that a user is following.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset
sort Yes Values documented below
persona Yes Values documented below

sort values:

Value
recommended
trending
useronline
userlevel
mostliked

persona values:

Value
player
designer
artist
animator
audio
curator

GET user/following/creations

Returns a list of creations that a user is following.

Query param Optional Details
id No User's indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType
sort Yes Values documented below

sort values:

Value
recommended
trending
releasedate
mostrecent
mostliked
mostplayed
mostused

POST user/metadata/edit

Updates user metadata. Requires JWT auth.

GET creation/profile

Returns the details of a creation.

Query param Optional Details
creationId No Creation indreamsID

GET creation/credits

Returns a list of users who contributed to elements of this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset

GET creation/photos

Returns a list of screenshots featuring this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset

GET creation/streamed-by

Returns a list of users who streamed this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset
sort Yes Values documented below
persona Yes Values documented below

sort values:

Value
recommended
trending
useronline
userlevel
mostliked

persona values:

Value
player
designer
artist
animator
audio
curator

GET creation/genealogy

Returns creations that are featured in this creation, as well as collections and remixes that feature this creation.

Query param Optional Details
id No Creation indreamsID
versionId Yes Creation version indreamsID

GET creation/usedin

Returns creations that feature this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType

GET creation/contents

Returns creations that are used in this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType

GET creation/remixes

Returns remixes of this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset
categories Yes Array of categories
tags Yes Array of tag IDs
type Yes CreationType

GET creation/followers

Returns a list of users who are following this creation.

Query param Optional Details
id No Creation indreamsID
start Yes Pagination offset

GET comment/search

Returns a list of comments or reviews for a creation.

Query param Optional Details
id No Creation indreamsID
type Yes Comment type
start Yes Pagination offset

type values:

type
COMMENT
REVIEW
FEEDBACK
BUG

GET comment/report

Returns a comment report form or something.

Query param Optional Details
commentId No Comment indreamsID

POST comment/add

Returns a comment report form or something.

The request payload is JSON with the following keys:

Key Optional Details
subjectId No IndreamsID for the thing to be commented on, can be a dream, user or collection
text No Comment content
type No Comment type
parentId Yes IndreamsID for a comment to reply to

type values:

type
COMMENT
REVIEW
FEEDBACK
BUG

POST comment/delete

Deletes a comment.

The request payload is JSON with the following keys:

Key Optional Details
id No comment IndreamsID

POST comment/id

Upvote/downvote a comment.

The request payload is JSON with the following keys:

Key Optional Details
id No comment IndreamsID
vote No -1 for downvote, 1 for upvote, 0 for reset

GET photo/profile

Returns details for a photo.

Query param Optional Details
photoId No Photo indreamsID

GET text/locale

Gets the localisation text for the indreams.me website.

Query param Optional Details
locale Yes Defaults to en_US

locale values:

Locale Language
ar_SA Arabic
da_DK Danish
de_DE German
en_GB English (UK)
en_US English (US)
es_ES Spanish (Spain)
es_MX Spanish (Latin America)
fi_FI Finnish
fr_FR French (France)
it_IT Italian
ja_JP Japanese
ko_KR Korean
nl_NL Dutch
no_NO Norweigan
pl_PL Polish
pt_BR Portuguese (Brazil)
pt_PT Portuguese (Portugal)
ru_RU Russian
sv_SE Swedish
zh_HANS Chinese (Simplified)
zh_HANT Chinese (Traditional)

POST audio/import

Imports audio into the game. This only actually works for accounts that can enter "Alex Evans mode" (devs, admins and CMs).

Audio Import Auth Headers

This endpoint requires JWT auth, and a variant of HMAC auth that works slightly differently.

Header Value
X-Auth Hash digest as a hex string
X-TS Current time in seconds
X-Filename URL-safe audio filename

The hash is an sha-256 HMAC using the key gUkXp2s5v8y/B?E(H+MbQeThWmYq3t6w. It's calculated from the following data, in order:

  • The audio filename, formatted to be URL-safe
  • The request path (not including the domain but including the query string)
  • The current time (in seconds, as a string)

Audio Data

The post body contains the audio data. Audio is signed integer 32-bit PCM sampled at 48000Hz (I think?), with either 1 or 2 channels, with the following header structure:

Header:

Offset Type Details
0 Int32 Number of header ints (16 * number of blocks + 8)
4 Int32 Number of channels (1 or 2)
8 Int32 Total number of bytes in the whole file
12 to 32 null not used

Block Table:

Offset Type Details
0 Int32 start offset
4 Int32 end offset
8 Int32 note (in the 12-tone chromatic scale?)
12 Int32 finetune
16 Int32 gain
20 Int32 playmode? can be 1 or 0
24 Int32 loop start
28 Int32 loop end
32 to 64 null not used

After the header is the audio data, stored in blocks of 2048 samples each.

Types

CreationType

Value
all
dreams
scenes
elements
collections

PersonaType

Key Value
e EXPLORER
c CREATOR
a ARTIST
n ANIMATOR
m MAESTRO
u CURATOR