Create Activity Stream
const url = 'https://api.wink.travel/api/activity-stream';const options = { method: 'POST', headers: {'Wink-Version': '2.0', 'Content-Type': 'application/json'}, body: '{"acl":"EVERYONE","entityIdentifier":"","eventDate":"","emotion":"","comment":"","i18nKey":"","attachmentId":"","user":""}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wink.travel/api/activity-stream \ --header 'Content-Type: application/json' \ --header 'Wink-Version: 2.0' \ --data '{ "acl": "EVERYONE", "entityIdentifier": "", "eventDate": "", "emotion": "", "comment": "", "i18nKey": "", "attachmentId": "", "user": "" }'Add a new activity stream entry.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”object
Who can track this stream?
Example
EVERYONEID of tracked entity
Example
booking-1Optional way to indicate when event occurred
Optional emotion. The actual implementation of the emotion is down to the consumer of the stream.
Example
fireOptional comment. For when the activity was created manually by a user. If i18nKey is not populated, comment is required.
Example
I am all fired up!Optional localized key. Key will be used to generate text on the front-end. If comment is not populated, i18n is required.
Example
ACTIVITY.UPLOADEDOptional attachment. For when we allow users to upload documents to the activity via Cloudinary.
Example
test.pdfOptional user. Attached when an authenticated user is available in the context of the activity.
object
User ID of authenticated person that created the stream.
Example
user-1Full name of user.
Example
Jane DoeOptional url of user’s profile picture
Responses
Section titled “ Responses ”Created
object
Document UUID
Datetime this record was first created
Datetime this record was last updated
Version property that shows how many times this document has been persisted. Document will not persist if the version property is less than current version property in the system. Result in an optimistic locking exception.
Who can track this stream?
ID of tracked entity
Optional emotion. The actual implementation of the emotion is down to the consumer of the stream.
Optional comment. For when the activity was created manually by a user. If i18nKey is not populated, comment is required.
Localized key. Key will be used to generate text on the front-end. If comment is not populated, i18n is required.
Optional attachment. For when we allow users to upload documents to the activity via Cloudinary.
Optional user. Attached when an authenticated user is available in the context of the activity.
object
User ID of authenticated person that created the stream.
Full name of user.
Optional url of user’s profile picture
Example
{ "id": "", "createdDate": "", "lastUpdate": "", "version": "", "acl": "EVERYONE", "entityIdentifier": "", "emotion": "", "comment": "", "i18nKey": "", "attachmentId": "", "user": ""}Bad Request
object
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}object
object
object
object
object
object
object
object
Unauthorized
object
object
Forbidden
object
object
Internal Server Error
object
Example generated
{}