Method signature
This method allows you to offer a user to add a moment from the game with a link to it:
To create a moment, you must upload an image in an application’s album (details - here).
Example with a link to an application
Example without a link to an application
Method parameters
Name | Required | Type | Description |
mediaId | Yes | Number | ID of the image that belongs to the application |
href | Yes | Href | Address of the link added to the moments |
text | Yes | String | Text - description of the attached link |
Callback example
As a result of this method, the user will be suggested add a moment to their personal page.
Callback when moment was created
method:”postMoment”
result:”ok”
data:”{"id":991157182481”} // moment ID
Callback when user declined to create a moment
method:”postMoment”
result:”error”
data:”cancelled by user”
Callback when link was incorrect
method:”postMoment”
result:”error”
data:”found link block with invalid href”
Callback when link was empty
method:”postMoment”
result:”error”
data:”found link block with empty href”
Callback when image ID was incorrect
method:”postMoment”
result:”error”
data:”mediaId does not match the application”
Callback when text was empty
method:”postMoment”
result:”error”
data:”found link block with empty text”
Callback when limit was reached
method:”postMoment”
result:”error”
data:”Limit reached. Next available at: 1727951737419”
Callback when an error occurred
method:”postMoment” result:”error” data:”api.communication-error”