AUTHENTICATED scope can execute createPost mutation.
The current API user will be set as an author. A content such as a started or passed learning path, an acquired certificate or an earned badge can be shared.
If the provided content doesn’t relate to the current API user, it will be skipped, and a post will be created only with the text.
Mutation has a single required incoming argument - data that represents PostCreationInput object:
| Parameter | Type | Description |
|---|---|---|
text | String | Required. The post body text. Available HTML tags are: <a>, <p>, <br>. Any other tag will be trimmed. |
sharedContent | PostSharedContentInput | Optional. Contains the data related to the content that is going to be shared in the post (learning path/certificate/badge). |
imagesBase64 | [UploadedFileInput] | The list of post images, each one should be formatted as base64 string. Up to 10 images can be shared, max file size - 20Mb. Allowed extensions: png, jpg, jpeg, gif. Leave empty to not attach any images to the post. Warning: once the post was created, this property cannot be updated. |
filesBase64 | [UploadedFileInput] | The post files, each one should be formatted as base64 string. Up to 10 files can be shared, max file size - 20Mb. Allowed extensions: txt, pdf, doc, docx, xls, xlsx, ppt, pptx, svg. Leave empty to not attach any files to the post. Warning: once the post was created, this property cannot be updated. |
communityId | ID | Should be filled if the post relates to a community. Leave empty to create a regular post. In case if it’s filled, the created post will be visible not only to the current user’s network, but to all members of the given community. Warning: once the post was created, this property cannot be updated. |
PostSharedContentInput object
| Parameter | Type | Description |
|---|---|---|
contentId | ID | Required. ID of the shared content (learning path/certificate/badge). |
contentType | PostSharedContentType | Required. Contains the type of the shared content. Available options: LEARNING_PATH, CERTIFICATE, BADGE. |
getPaginatedUserCertificates query.
Only public trainings that have been started or passed by the current API user can be shared.
To get the list of learning paths (trainings) available for sharing, the getTrainingsForSharing query should be called.
Also, any badge that has been earned by the current API user can be shared. To get the list of the available badges, use query getBadges.
UploadedFileInput object
Represents an input data to upload a new file through the API.
| Parameter | Type | Description |
|---|---|---|
filename | String | Required. A name of the file that should be created. Available file extensions depend on the entity that should be created. |
contentBase64 | String | Required. File content formatted as a base64 string. The limit for the file upload is 20 Mb (or the limit that is set for the file upload on the server, if it’s less than 20 Mb). |
An example of a post creation
Post object. Detailed description and the full list of available properties can be found here.