Repository: VKCOM/vk-php-sdk Branch: master Commit: cf5b8d844402 Files: 526 Total size: 954.2 KB Directory structure: gitextract_yhkxhuck/ ├── LICENSE ├── README.md ├── composer.json ├── examples/ │ └── oauth/ │ ├── group.php │ └── user.php ├── phpunit.xml └── src/ └── VK/ ├── Actions/ │ ├── Account.php │ ├── Ads.php │ ├── AppWidgets.php │ ├── Apps.php │ ├── Auth.php │ ├── Board.php │ ├── Bugtracker.php │ ├── Calls.php │ ├── Database.php │ ├── Docs.php │ ├── Donut.php │ ├── DownloadedGames.php │ ├── Execute.php │ ├── Fave.php │ ├── Friends.php │ ├── Gifts.php │ ├── Groups.php │ ├── LeadForms.php │ ├── Likes.php │ ├── Market.php │ ├── Messages.php │ ├── Newsfeed.php │ ├── Notes.php │ ├── Notifications.php │ ├── Orders.php │ ├── Pages.php │ ├── Photos.php │ ├── Podcasts.php │ ├── Polls.php │ ├── PrettyCards.php │ ├── Search.php │ ├── Secure.php │ ├── Stats.php │ ├── Status.php │ ├── Storage.php │ ├── Store.php │ ├── Stories.php │ ├── Streaming.php │ ├── Translations.php │ ├── Users.php │ ├── Utils.php │ ├── Video.php │ ├── Wall.php │ └── Widgets.php ├── CallbackApi/ │ ├── VKCallbackApiHandler.php │ ├── VKCallbackApiLongPollExecutor.php │ └── VKCallbackApiServerHandler.php ├── Client/ │ ├── Actions/ │ │ └── ActionInterface.php │ ├── Enums/ │ │ └── VKLanguage.php │ ├── VKApiClient.php │ ├── VKApiError.php │ └── VKApiRequest.php ├── Enums/ │ ├── AccountGetBannedFields.php │ ├── AccountGetCountersFilter.php │ ├── AccountGetInfoFields.php │ ├── AccountSaveProfileInfoBdateVisibility.php │ ├── AccountSaveProfileInfoRelation.php │ ├── AccountSaveProfileInfoSex.php │ ├── AccountSetInfoName.php │ ├── AdsCheckLinkLinkType.php │ ├── AdsGetCampaignsFields.php │ ├── AdsGetDemographicsIdsType.php │ ├── AdsGetDemographicsPeriod.php │ ├── AdsGetPostsReachIdsType.php │ ├── AdsGetStatisticsIdsType.php │ ├── AdsGetStatisticsPeriod.php │ ├── AdsGetStatisticsStatsFields.php │ ├── AdsGetSuggestionsSection.php │ ├── AdsGetTargetingStatsAdFormat.php │ ├── AdsGetUploadURLAdFormat.php │ ├── AppWidgetsGetAppImageUploadServerImageType.php │ ├── AppWidgetsGetAppImagesImageType.php │ ├── AppWidgetsGetGroupImageUploadServerImageType.php │ ├── AppWidgetsGetGroupImagesImageType.php │ ├── AppWidgetsUpdateType.php │ ├── AppsAddSnippetButton.php │ ├── AppsAddSnippetVkRef.php │ ├── AppsGetAppFields.php │ ├── AppsGetCatalogFields.php │ ├── AppsGetCatalogFilter.php │ ├── AppsGetCatalogSort.php │ ├── AppsGetFields.php │ ├── AppsGetFriendsListFields.php │ ├── AppsGetFriendsListType.php │ ├── AppsGetLeaderboardType.php │ ├── AppsGetPlatform.php │ ├── AppsGetScopesType.php │ ├── AppsSendRequestType.php │ ├── AppsUpdateMetaForTestingGroupPlatforms.php │ ├── Base/ │ │ └── NameCase.php │ ├── BaseLang.php │ ├── BoardGetCommentsSort.php │ ├── BoardGetTopicsOrder.php │ ├── BoardGetTopicsPreview.php │ ├── BugtrackerGetBugreportByIdFields.php │ ├── BugtrackerGetCompanyGroupMembersFields.php │ ├── BugtrackerGetCompanyMembersFields.php │ ├── BugtrackerGetCompanyMembersFilterRole.php │ ├── BugtrackerSetCompanyMemberRoleRole.php │ ├── DocsGetMessagesUploadServerType.php │ ├── DocsGetType.php │ ├── DonutGetSubscriptionsFields.php │ ├── FaveAddTagPosition.php │ ├── FaveGetFields.php │ ├── FaveGetItemType.php │ ├── FaveGetPagesFields.php │ ├── FaveGetPagesType.php │ ├── FaveSetTagsItemType.php │ ├── FriendsGetFields.php │ ├── FriendsGetOrder.php │ ├── FriendsGetRequestsFields.php │ ├── FriendsGetRequestsSort.php │ ├── FriendsGetSuggestionsFields.php │ ├── FriendsGetSuggestionsFilter.php │ ├── FriendsSearchFields.php │ ├── Groups/ │ │ ├── AddressWorkInfoStatus.php │ │ ├── GroupAccess.php │ │ ├── GroupAgeLimits.php │ │ ├── GroupAudio.php │ │ ├── GroupDocs.php │ │ ├── GroupMarketCurrency.php │ │ ├── GroupPhotos.php │ │ ├── GroupRole.php │ │ ├── GroupSubject.php │ │ ├── GroupTopics.php │ │ ├── GroupVideo.php │ │ ├── GroupWall.php │ │ ├── GroupWiki.php │ │ └── MarketState.php │ ├── GroupsCreateSubtype.php │ ├── GroupsCreateType.php │ ├── GroupsGetAddressesFields.php │ ├── GroupsGetBannedFields.php │ ├── GroupsGetByIdFields.php │ ├── GroupsGetFields.php │ ├── GroupsGetFilter.php │ ├── GroupsGetInvitedUsersFields.php │ ├── GroupsGetMembersFields.php │ ├── GroupsGetMembersFilter.php │ ├── GroupsGetMembersSort.php │ ├── GroupsGetRequestsFields.php │ ├── GroupsSearchSort.php │ ├── GroupsSearchType.php │ ├── GroupsTagAddTagColor.php │ ├── GroupsTagBindAct.php │ ├── LikesGetListFilter.php │ ├── LikesGetListFriendsOnly.php │ ├── LikesType.php │ ├── MarketEditOrderPaymentStatus.php │ ├── MarketGetCommentsFields.php │ ├── MarketGetCommentsSort.php │ ├── MarketReportCommentReason.php │ ├── MarketReportReason.php │ ├── MarketSearchItemsBasicSortBy.php │ ├── MarketSearchItemsBasicSortDirection.php │ ├── MarketSearchItemsSortBy.php │ ├── MarketSearchItemsSortDirection.php │ ├── MarketSearchRev.php │ ├── MarketSearchSort.php │ ├── MessagesGetByConversationMessageIdFields.php │ ├── MessagesGetByIdFields.php │ ├── MessagesGetChatFields.php │ ├── MessagesGetChatPreviewFields.php │ ├── MessagesGetConversationMembersFields.php │ ├── MessagesGetConversationsByIdFields.php │ ├── MessagesGetConversationsFields.php │ ├── MessagesGetConversationsFilter.php │ ├── MessagesGetHistoryAttachmentsAttachmentTypes.php │ ├── MessagesGetHistoryAttachmentsFields.php │ ├── MessagesGetHistoryAttachmentsMediaType.php │ ├── MessagesGetHistoryFields.php │ ├── MessagesGetHistoryRev.php │ ├── MessagesGetImportantMessagesFields.php │ ├── MessagesGetIntentUsersIntent.php │ ├── MessagesGetLongPollHistoryFields.php │ ├── MessagesMuteChatMentionsMentionStatus.php │ ├── MessagesSearchConversationsFields.php │ ├── MessagesSendIntent.php │ ├── MessagesSetActivityType.php │ ├── Newsfeed/ │ │ └── IgnoreItemType.php │ ├── NewsfeedGetBannedFields.php │ ├── NewsfeedGetCommentsFields.php │ ├── NewsfeedGetCommentsFilters.php │ ├── NewsfeedGetFields.php │ ├── NewsfeedGetFilters.php │ ├── NewsfeedGetRecommendedFields.php │ ├── NewsfeedGetSuggestedSourcesFields.php │ ├── NewsfeedSearchFields.php │ ├── NewsfeedUnsubscribeType.php │ ├── NotesGetCommentsSort.php │ ├── NotesGetSort.php │ ├── NotificationsGetFilters.php │ ├── NotificationsSendMessageSendingMode.php │ ├── OrdersChangeStateAction.php │ ├── PagesSaveAccessEdit.php │ ├── PagesSaveAccessView.php │ ├── PhotosGetCommentsFields.php │ ├── PhotosGetCommentsSort.php │ ├── PhotosReportCommentReason.php │ ├── PhotosReportReason.php │ ├── PollsCreateBackgroundId.php │ ├── PollsEditBackgroundId.php │ ├── PollsGetVotersFields.php │ ├── StatsGetInterval.php │ ├── StatsTrackVisitorType.php │ ├── Stories/ │ │ └── UploadLinkText.php │ ├── StoriesGetBannedFields.php │ ├── StoriesGetByIdFields.php │ ├── StoriesGetFields.php │ ├── StoriesGetRepliesFields.php │ ├── StoriesGetViewersFields.php │ ├── StoriesSaveFields.php │ ├── StoriesSearchFields.php │ ├── StreamingGetStatsInterval.php │ ├── StreamingGetStatsType.php │ ├── UsersGetFields.php │ ├── UsersGetFollowersFields.php │ ├── UsersGetSubscriptionsFields.php │ ├── UsersReportType.php │ ├── UsersSearchFields.php │ ├── UsersSearchSex.php │ ├── UsersSearchSort.php │ ├── UsersSearchStatus.php │ ├── UtilsGetLinkStatsInterval.php │ ├── UtilsGetLinkStatsSource.php │ ├── VideoAddAlbumPrivacy.php │ ├── VideoEditAlbumPrivacy.php │ ├── VideoGetCommentsSort.php │ ├── VideoGetSortAlbum.php │ ├── VideoReportCommentReason.php │ ├── VideoReportReason.php │ ├── VideoSearchFilters.php │ ├── VideoSearchSort.php │ ├── Wall/ │ │ └── GetFilter.php │ ├── WallEditTopicId.php │ ├── WallGetByIdFields.php │ ├── WallGetCommentFields.php │ ├── WallGetCommentsFields.php │ ├── WallGetCommentsSort.php │ ├── WallGetFields.php │ ├── WallReportCommentReason.php │ ├── WallReportPostReason.php │ ├── WallSearchFields.php │ └── WidgetsGetCommentsFields.php ├── Exceptions/ │ ├── Api/ │ │ ├── ExceptionMapper.php │ │ ├── VKApiAccessAlbumException.php │ │ ├── VKApiAccessAudioException.php │ │ ├── VKApiAccessCommentException.php │ │ ├── VKApiAccessException.php │ │ ├── VKApiAccessGroupException.php │ │ ├── VKApiAccessGroupsException.php │ │ ├── VKApiAccessMarketException.php │ │ ├── VKApiAccessNoteCommentException.php │ │ ├── VKApiAccessNoteException.php │ │ ├── VKApiAccessPageException.php │ │ ├── VKApiAccessVideoException.php │ │ ├── VKApiActionFailedException.php │ │ ├── VKApiAdditionalSignupRequiredException.php │ │ ├── VKApiAdsLookalikeRequestAlreadyInProgressException.php │ │ ├── VKApiAdsLookalikeRequestAudienceTooLargeException.php │ │ ├── VKApiAdsLookalikeRequestAudienceTooSmallException.php │ │ ├── VKApiAdsLookalikeRequestExportAlreadyInProgressException.php │ │ ├── VKApiAdsLookalikeRequestExportMaxCountPerDayReachedException.php │ │ ├── VKApiAdsLookalikeRequestExportRetargetingGroupLimitException.php │ │ ├── VKApiAdsLookalikeRequestMaxCountPerDayReachedException.php │ │ ├── VKApiAdsObjectDeletedException.php │ │ ├── VKApiAdsPartialSuccessException.php │ │ ├── VKApiAdsPermissionException.php │ │ ├── VKApiAdsSpecificException.php │ │ ├── VKApiAlbumFullException.php │ │ ├── VKApiAlbumsLimitException.php │ │ ├── VKApiAppAuthException.php │ │ ├── VKApiAppsAlreadyUnlockedException.php │ │ ├── VKApiAppsEmptyFilterParamsException.php │ │ ├── VKApiAppsEmptySnippetDataException.php │ │ ├── VKApiAppsNotFoundSnippetException.php │ │ ├── VKApiAppsSubscriptionInvalidStatusException.php │ │ ├── VKApiAppsSubscriptionNotFoundException.php │ │ ├── VKApiAppsTooManySnippetsException.php │ │ ├── VKApiAssertVotesException.php │ │ ├── VKApiAuthAccessTokenHasExpiredException.php │ │ ├── VKApiAuthAnonymousTokenHasExpiredException.php │ │ ├── VKApiAuthAnonymousTokenIpMismatchException.php │ │ ├── VKApiAuthAnonymousTokenIsInvalidException.php │ │ ├── VKApiAuthException.php │ │ ├── VKApiAuthFloodException.php │ │ ├── VKApiAuthHttpsException.php │ │ ├── VKApiAuthValidationException.php │ │ ├── VKApiBlockedException.php │ │ ├── VKApiCallbackApiServersLimitException.php │ │ ├── VKApiCaptchaException.php │ │ ├── VKApiClientUpdateNeededException.php │ │ ├── VKApiClientVersionDeprecatedException.php │ │ ├── VKApiCompileException.php │ │ ├── VKApiCuaConfirmationRequiredException.php │ │ ├── VKApiDisabledException.php │ │ ├── VKApiEmailConfirmationNeedException.php │ │ ├── VKApiEnabledInTestException.php │ │ ├── VKApiFaveAliexpressTagException.php │ │ ├── VKApiFloodException.php │ │ ├── VKApiFriendsAddEnemyException.php │ │ ├── VKApiFriendsAddInEnemyException.php │ │ ├── VKApiFriendsAddNotFoundException.php │ │ ├── VKApiFriendsAddYourselfException.php │ │ ├── VKApiFriendsListIdException.php │ │ ├── VKApiFriendsListLimitException.php │ │ ├── VKApiFriendsTooManyFriendsException.php │ │ ├── VKApiGroupAppIsNotInstalledInCommunityException.php │ │ ├── VKApiGroupAuthException.php │ │ ├── VKApiGroupChangeCreatorException.php │ │ ├── VKApiGroupHostNeed2faException.php │ │ ├── VKApiGroupInviteLinksNotValidException.php │ │ ├── VKApiGroupNeed2faException.php │ │ ├── VKApiGroupNotInClubException.php │ │ ├── VKApiGroupTooManyAddressesException.php │ │ ├── VKApiGroupTooManyOfficersException.php │ │ ├── VKApiInsufficientFundsException.php │ │ ├── VKApiInvalidAddressException.php │ │ ├── VKApiIpIsNotAllowedException.php │ │ ├── VKApiLikesReactionCanNotBeAppliedException.php │ │ ├── VKApiLimitsException.php │ │ ├── VKApiMarketAddToMarketAlbumException.php │ │ ├── VKApiMarketAddToServiceAlbumException.php │ │ ├── VKApiMarketAlbumMainHiddenException.php │ │ ├── VKApiMarketAlbumNotFoundException.php │ │ ├── VKApiMarketCantChangeVkpayStatusException.php │ │ ├── VKApiMarketCommentsClosedException.php │ │ ├── VKApiMarketDisabledException.php │ │ ├── VKApiMarketExtendedNotEnabledException.php │ │ ├── VKApiMarketFailedToSetAlbumAsMainException.php │ │ ├── VKApiMarketFailedToUnsetAlbumAsMainException.php │ │ ├── VKApiMarketGroupingAlreadyHasSuchVariantException.php │ │ ├── VKApiMarketGroupingHasOtherPropertiesException.php │ │ ├── VKApiMarketGroupingItemsMustHaveDistinctPropertiesException.php │ │ ├── VKApiMarketGroupingItemsWithDifferentPropertiesException.php │ │ ├── VKApiMarketGroupingMustContainMoreThanOneItemException.php │ │ ├── VKApiMarketGroupingMustHaveVariantsException.php │ │ ├── VKApiMarketInvalidDimensionsException.php │ │ ├── VKApiMarketItemAlreadyAddedException.php │ │ ├── VKApiMarketItemHasBadLinksException.php │ │ ├── VKApiMarketItemIsNotDeletedException.php │ │ ├── VKApiMarketItemNotFoundException.php │ │ ├── VKApiMarketMaxPropertiesLimitExceedException.php │ │ ├── VKApiMarketMaxVariantsLimitExceedException.php │ │ ├── VKApiMarketNameTooLongException.php │ │ ├── VKApiMarketNotEnabledException.php │ │ ├── VKApiMarketOrdersInvalidStatusException.php │ │ ├── VKApiMarketOrdersNoCartItemsException.php │ │ ├── VKApiMarketOrdersOrderNotFoundException.php │ │ ├── VKApiMarketPhotosCropInvalidFormatException.php │ │ ├── VKApiMarketPhotosCropOverflowException.php │ │ ├── VKApiMarketPhotosCropSizeTooLowException.php │ │ ├── VKApiMarketPropertyNotFoundException.php │ │ ├── VKApiMarketRestoreTooLateException.php │ │ ├── VKApiMarketServicesDisabledException.php │ │ ├── VKApiMarketShopAlreadyDisabledException.php │ │ ├── VKApiMarketShopAlreadyEnabledException.php │ │ ├── VKApiMarketTooManyAlbumsException.php │ │ ├── VKApiMarketTooManyItemsException.php │ │ ├── VKApiMarketTooManyItemsInAlbumException.php │ │ ├── VKApiMarketUnknownPropertyTypeException.php │ │ ├── VKApiMarketVariantNotFoundException.php │ │ ├── VKApiMarketVariantValueTooLongException.php │ │ ├── VKApiMarketVariantsException.php │ │ ├── VKApiMarketVariantsNotEnabledException.php │ │ ├── VKApiMessagesCantChangeInviteLinkException.php │ │ ├── VKApiMessagesCantDeleteForAllException.php │ │ ├── VKApiMessagesCantEditPinnedYetException.php │ │ ├── VKApiMessagesCantFwdException.php │ │ ├── VKApiMessagesCantPinExpiringMessageException.php │ │ ├── VKApiMessagesCantPinOneTimeStoryException.php │ │ ├── VKApiMessagesCantSeeInviteLinkException.php │ │ ├── VKApiMessagesChatBotFeatureException.php │ │ ├── VKApiMessagesChatDisabledException.php │ │ ├── VKApiMessagesChatNotAdminException.php │ │ ├── VKApiMessagesChatNotExistException.php │ │ ├── VKApiMessagesChatUnsupportedException.php │ │ ├── VKApiMessagesChatUserLeftException.php │ │ ├── VKApiMessagesChatUserNoAccessException.php │ │ ├── VKApiMessagesChatUserNotInChatException.php │ │ ├── VKApiMessagesContactNotFoundException.php │ │ ├── VKApiMessagesDenySendException.php │ │ ├── VKApiMessagesDropDeviceCacheException.php │ │ ├── VKApiMessagesEditExpiredException.php │ │ ├── VKApiMessagesEditKindDisallowedException.php │ │ ├── VKApiMessagesForbiddenReactionException.php │ │ ├── VKApiMessagesGroupForNotificationsOnlyException.php │ │ ├── VKApiMessagesGroupPeerAccessException.php │ │ ├── VKApiMessagesIntentCantUseException.php │ │ ├── VKApiMessagesIntentLimitOverflowException.php │ │ ├── VKApiMessagesInvalidReactionIdException.php │ │ ├── VKApiMessagesKeyboardInvalidException.php │ │ ├── VKApiMessagesMemberAccessToGroupDeniedException.php │ │ ├── VKApiMessagesMessageCannotBeForwardedException.php │ │ ├── VKApiMessagesMessageRequestAlreadySentException.php │ │ ├── VKApiMessagesNeedMessageRequestException.php │ │ ├── VKApiMessagesPeerBlockedReasonByTimeException.php │ │ ├── VKApiMessagesPendingMessageRequestException.php │ │ ├── VKApiMessagesPrivacyException.php │ │ ├── VKApiMessagesReactionsLimitReachedException.php │ │ ├── VKApiMessagesTooBigException.php │ │ ├── VKApiMessagesTooLongForwardsException.php │ │ ├── VKApiMessagesTooLongMessageException.php │ │ ├── VKApiMessagesTooManyPostsException.php │ │ ├── VKApiMessagesTooNewPtsException.php │ │ ├── VKApiMessagesTooOldPtsException.php │ │ ├── VKApiMessagesUserBlockedException.php │ │ ├── VKApiMessagesUserNotDonException.php │ │ ├── VKApiMessagesWritingDisabledForChatException.php │ │ ├── VKApiMethodAdsException.php │ │ ├── VKApiMethodDisabledException.php │ │ ├── VKApiMethodException.php │ │ ├── VKApiMethodPermissionException.php │ │ ├── VKApiMobileNotActivatedException.php │ │ ├── VKApiNeedConfirmationException.php │ │ ├── VKApiNeedTokenConfirmationException.php │ │ ├── VKApiNotFoundException.php │ │ ├── VKApiNotImplementedYetException.php │ │ ├── VKApiNotSupportedHttpMethodException.php │ │ ├── VKApiOtpValidationNeedException.php │ │ ├── VKApiParamAlbumIdException.php │ │ ├── VKApiParamApiIdException.php │ │ ├── VKApiParamDocAccessException.php │ │ ├── VKApiParamDocDeleteAccessException.php │ │ ├── VKApiParamDocIdException.php │ │ ├── VKApiParamDocRestoreAccessException.php │ │ ├── VKApiParamDocRestoreTimeoutException.php │ │ ├── VKApiParamDocTitleException.php │ │ ├── VKApiParamException.php │ │ ├── VKApiParamGroupIdException.php │ │ ├── VKApiParamHashException.php │ │ ├── VKApiParamNoteIdException.php │ │ ├── VKApiParamPageIdException.php │ │ ├── VKApiParamPhotoException.php │ │ ├── VKApiParamPhotosException.php │ │ ├── VKApiParamServerException.php │ │ ├── VKApiParamTimestampException.php │ │ ├── VKApiParamTitleException.php │ │ ├── VKApiParamUserIdException.php │ │ ├── VKApiPasswordValidationNeedException.php │ │ ├── VKApiPermissionException.php │ │ ├── VKApiPhoneValidationNeedException.php │ │ ├── VKApiPhotoChangedException.php │ │ ├── VKApiPollsAccessException.php │ │ ├── VKApiPollsAccessWithoutVoteException.php │ │ ├── VKApiPollsAnswerIdException.php │ │ ├── VKApiPollsPollIdException.php │ │ ├── VKApiPrettyCardsCardIsConnectedToPostException.php │ │ ├── VKApiPrettyCardsCardNotFoundException.php │ │ ├── VKApiPrettyCardsTooManyCardsException.php │ │ ├── VKApiPrivateProfileException.php │ │ ├── VKApiRateLimitException.php │ │ ├── VKApiRecaptchaException.php │ │ ├── VKApiRequestException.php │ │ ├── VKApiRuntimeException.php │ │ ├── VKApiSaveFileException.php │ │ ├── VKApiSectionDisabledException.php │ │ ├── VKApiServerException.php │ │ ├── VKApiSignatureException.php │ │ ├── VKApiStatusNoAudioException.php │ │ ├── VKApiStickersNotFavoriteException.php │ │ ├── VKApiStickersNotPurchasedException.php │ │ ├── VKApiStickersTooManyFavoritesException.php │ │ ├── VKApiStoryExpiredException.php │ │ ├── VKApiStoryIncorrectReplyPrivacyException.php │ │ ├── VKApiTimeoutException.php │ │ ├── VKApiTokenExtensionRequiredException.php │ │ ├── VKApiTooManyException.php │ │ ├── VKApiTooManyListsException.php │ │ ├── VKApiTranslationsCantTranslateException.php │ │ ├── VKApiTranslationsMultipleSourceLangException.php │ │ ├── VKApiUnknownApplicationException.php │ │ ├── VKApiUnknownException.php │ │ ├── VKApiUnknownGroupException.php │ │ ├── VKApiUnknownUserException.php │ │ ├── VKApiUploadException.php │ │ ├── VKApiUserBannedException.php │ │ ├── VKApiUserDeactivatedException.php │ │ ├── VKApiUserDeletedException.php │ │ ├── VKApiUserServiceDeactivatedException.php │ │ ├── VKApiVideoAlreadyAddedException.php │ │ ├── VKApiVideoCommentsClosedException.php │ │ ├── VKApiVotesPermissionException.php │ │ ├── VKApiWaitException.php │ │ ├── VKApiWallAccessAddReplyException.php │ │ ├── VKApiWallAccessCommentException.php │ │ ├── VKApiWallAccessPostException.php │ │ ├── VKApiWallAccessRepliesException.php │ │ ├── VKApiWallAddPostException.php │ │ ├── VKApiWallAdsPostLimitReachedException.php │ │ ├── VKApiWallAdsPublishedException.php │ │ ├── VKApiWallCheckLinkCantDetermineSourceException.php │ │ ├── VKApiWallCommentNotDeletedException.php │ │ ├── VKApiWallDonutException.php │ │ ├── VKApiWallLinksForbiddenException.php │ │ ├── VKApiWallReplyOwnerFloodException.php │ │ ├── VKApiWallTooManyRecipientsException.php │ │ └── VKApiWeightedFloodException.php │ ├── VKApiException.php │ ├── VKClientException.php │ ├── VKException.php │ ├── VKLongPollServerKeyExpiredException.php │ ├── VKLongPollServerTsException.php │ └── VKOAuthException.php ├── OAuth/ │ ├── AbstractOAuth.php │ ├── Group/ │ │ ├── DTO/ │ │ │ ├── AccessTokenParams.php │ │ │ └── AuthorizeUrlParams.php │ │ ├── Display.php │ │ ├── Group.php │ │ └── Scopes.php │ ├── ResponseType.php │ └── User/ │ ├── DTO/ │ │ ├── AuthorizeUrlParams.php │ │ ├── IdTokenParams.php │ │ ├── LogoutParams.php │ │ ├── RefreshTokensParams.php │ │ ├── Scopes.php │ │ ├── TokensParams.php │ │ └── ViewType.php │ └── User.php └── Transport/ └── Client.php ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2016 VK.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # vkcom/vk-php-sdk PHP library for VK API interaction, includes OAuth 2.0 authorization and API methods. Full VK API features documentation can be found [here](http://vk.com/dev). This library has been created using the VK API JSON Schema. It can be found [here](https://github.com/VKCOM/vk-api-schema). It uses VK API [version](https://vk.com/dev/versions) 5.199 [![Packagist](https://img.shields.io/packagist/v/vkcom/vkcom/vk-php-sdk.svg)](https://packagist.org/packages/vkcom/vkcom/vk-php-sdk) ## 1. Prerequisites * PHP 7 or PHP 8 ## 2. Installation The VK PHP SDK can be installed using Composer by running the following command: ```sh composer require vkcom/vk-php-sdk ``` ## 3. Initialization Create VKApiClient object using the following code: ```php $vk = new \VK\Client\VKApiClient(); ``` Also you can initialize `VKApiClient` with different API version and different language like this: ```php $vk = new VKApiClient('5.199'); ``` ```php $vk = new VKApiClient('5.199', \VK\Client\Enums\VKLanguage::ENGLISH); ``` ## 4. Authorization The library provides the authorization flows for user based on OAuth 2.0 protocol implementation in vk.com API. Please read the full [documentation](https://vk.com/dev/access_token) before you start. ### 4.1. Authorization Code Flow OAuth 2.0 Authorization Code Flow allows calling methods from the server side. This flow includes two steps — obtaining an authorization code and exchanging the code for an access token. Primarily you should obtain the "code" ([manual user access](https://vk.com/dev/authcode_flow_user) and [manual community access](https://vk.com/dev/authcode_flow_group)) by redirecting the user to the authorization page using the following method: Create `VKOAuth` object first: ```php $oauth = new \VK\OAuth\VKOAuth(); ``` #### 4.1.1. For getting **user access key** use following command: ```php $oauth = new \VK\OAuth\VKOAuth(); $client_id = 1234567; $redirect_uri = 'https://example.com/vk'; $display = \VK\OAuth\VKOAuthDisplay::PAGE; $scope = [\VK\OAuth\Scopes\VKOAuthUserScope::WALL, \VK\OAuth\Scopes\VKOAuthUserScope::GROUPS]; $state = 'secret_state_code'; $browser_url = $oauth->getAuthorizeUrl(\VK\OAuth\VKOAuthResponseType::CODE, $client_id, $redirect_uri, $display, $scope, $state); ``` #### 4.1.2. Or if you want to get **community access key** use: ```php $oauth = new \VK\OAuth\VKOAuth(); $client_id = 1234567; $redirect_uri = 'https://example.com/vk'; $display = \VK\OAuth\VKOAuthDisplay::PAGE; $scope = [\VK\OAuth\Scopes\VKOAuthGroupScope::MESSAGES]; $state = 'secret_state_code'; $groups_ids = [1, 2]; $browser_url = $oauth->getAuthorizeUrl(\VK\OAuth\VKOAuthResponseType::CODE, $client_id, $redirect_uri, $display, $scope, $state, $groups_ids); ``` [User access key](https://vk.com/dev/permissions?f=1.%20%D0%9F%D1%80%D0%B0%D0%B2%D0%B0%20%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%B0%20%D0%B4%D0%BB%D1%8F%20%D1%82%D0%BE%D0%BA%D0%B5%D0%BD%D0%B0%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8F) and [community access key](https://vk.com/dev/permissions?f=2.%20%D0%9F%D1%80%D0%B0%D0%B2%D0%B0%20%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%B0%20%D0%B4%D0%BB%D1%8F%20%D1%82%D0%BE%D0%BA%D0%B5%D0%BD%D0%B0%20%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D1%81%D1%82%D0%B2%D0%B0) uses different values inside scope array After successful authorization user's browser will be redirected to the specified **redirect_uri**. Meanwhile the code will be sent as a GET parameter to the specified address: ```sh https://example.com?code=CODE ``` Then use this method to get the access token: ```php $oauth = new \VK\OAuth\VKOAuth(); $client_id = 1234567; $client_secret = 'SDAScasd' $redirect_uri = 'https://example.com/vk'; $code = 'CODE'; $response = $oauth->getAccessToken($client_id, $client_secret, $redirect_uri, $code); $access_token = $response['access_token']; ``` The **redirect_uri** should be the URL that was used to get a code at the first step. ### 4.2. Implicit flow In difference with authorization code flow this flow gives you temporary access key. Read more about [user access key](https://vk.com/dev/implicit_flow_user) and [community access key](https://vk.com/dev/implicit_flow_group). First step to get access using Implicit flow is creating `VKOauth` object: ```php $oauth = new \VK\OAuth\VKOAuth(); ``` #### 4.2.1. For getting **user access key** use following command: ```php $oauth = new \VK\OAuth\VKOAuth(); $client_id = 1234567; $redirect_uri = 'https://example.com/vk'; $display = \VK\OAuth\VKOAuthDisplay::PAGE; $scope = [\VK\OAuth\Scopes\VKOAuthUserScope::WALL, \VK\OAuth\Scopes\VKOAuthUserScope::GROUPS]; $state = 'secret_state_code'; $revoke_auth = true; $browser_url = $oauth->getAuthorizeUrl(\VK\OAuth\VKOAuthResponseType::TOKEN, $client_id, $redirect_uri, $display, $scope, $state, null, $revoke_auth); ``` If you want to make user getting access anyway, set **revoke_auth** as true. #### 4.2.2. Or if you want to get **community access key** use: ```php $oauth = new \VK\OAuth\VKOAuth(); $client_id = 1234567; $redirect_uri = 'https://example.com/vk'; $display = \VK\OAuth\VKOAuthDisplay::PAGE; $scope = [\VK\OAuth\Scopes\VKOAuthGroupScope::MESSAGES]; $state = 'secret_state_code'; $groups_ids = [1, 2]; $browser_url = $oauth->getAuthorizeUrl(\VK\OAuth\VKOAuthResponseType::TOKEN, $client_id, $redirect_uri, $display, $scope, $state, $groups_ids); ``` Arguments are similar with authorization code flow After successful authorization user's browser will be redirected to the specified **redirect_uri**. Meanwhile the access token will be sent as a fragment parameter to the specified address: For **user access key** will be: ```sh https://example.com#access_token=533bacf01e11f55b536a565b57531ad114461ae8736d6506a3&expires_in=86400&user_id=8492&state=123456 ``` And for **community access key**: ```sh https://example.com#access_token_XXXXXX=533bacf01e11f55b536a565b57531ad114461ae8736d6506a3&expires_in=86400 ``` **access_token** is your new access token. **expires_in** is lifetime of access token in seconds. **user_id** is user identifier. **state** is string from `authorize` method. access_token_**XXXXXX** is community access token where XXXXXX is community identifier. ## 5. API Requests You can find the full list of VK API methods [here](https://vk.com/dev/methods). ### 5.1. Request sample Example of calling method **users.get**: ```php $vk = new \VK\Client\VKApiClient(); $response = $vk->users()->get($access_token, [ 'user_ids' => [1, 210700286], 'fields' => ['city', 'photo'], ]); ``` ### 5.2. Uploading Photos into a Private Message Please read [the full manual](https://vk.com/dev/upload_files?f=4.%20Uploading%20Photos%20into%20a%20Private%20Message) before the start. Call **photos.getMessagesUploadServer** to receive an upload address: ```php $vk = new \VK\Client\VKApiClient(); $address = $vk->photos()->getMessagesUploadServer('{access_token}'); ``` Then use **upload()** method to send files to the **upload_url** address received in the previous step: ```php $vk = new \VK\Client\VKApiClient(); $photo = $vk->getRequest()->upload($address['upload_url'], 'photo', 'photo.jpg'); ``` You will get a JSON object with **server**, **photo**, **hash** fields. To save a photo call **photos.saveMessagesPhoto ** with these three parameters: ```php $vk = new \VK\Client\VKApiClient(); $response_save_photo = $vk->photos()->saveMessagesPhoto($access_token, [ 'server' => $photo['server'], 'photo' => $photo['photo'], 'hash' => $photo['hash'], ]); ``` Then you can use **owner_id** and **id** parameters from the last response to create an attachment of the uploaded photo. ### 5.3. Uploading Video Files Please read [the full manual](https://vk.com/dev/upload_files_2?f=9.%20Uploading%20Video%20Files) before the start. Call **video.save** to get a video upload server address: ```php $vk = new \VK\Client\VKApiClient(); $address = $vk->video()->save($access_token, [ 'name' => 'My video', ]); ``` Send a file to **upload_url** received previously calling **upload()** method: ```php $vk = new \VK\Client\VKApiClient(); $video = $vk->getRequest()->upload($address['upload_url'], 'video_file', 'video.mp4'); ``` Videos are processed for some time after uploading. ## 6. Groups updates ### 6.1. Long Poll Enable Long Poll for your group and specify which events should be tracked by calling the following API method: ```php $vk = new \VK\Client\VKApiClient(); $vk->groups()->setLongPollSettings($access_token, [ 'group_id' => 159895463, 'enabled' => 1, 'message_new' => 1, 'wall_post_new' => 1, ]); ``` Override methods from VK\CallbackApi\VKCallbackApiHandler class for handling events: ```php class CallbackApiMyHandler extends VK\CallbackApi\VKCallbackApiHandler { public function messageNew($object) { echo 'New message: ' . $object['body']; } public function wallPostNew($object) { echo 'New wall post: ' . $object['text']; } } ``` To start listening to LongPoll events, create an instance of your CallbackApiMyHandler class, instance of VK\CallbackApi\LongPoll\VKCallbackApiLongPollExecutor class and call method listen(): ```php $vk = new \VK\Client\VKApiClient(); $access_token = 'asdj4iht2i4ntokqngoiqn3ripogqr'; $group_id = 159895463; $wait = 25; $handler = new CallbackApiMyHandler(); $executor = new \VK\CallbackApi\VKCallbackApiLongPollExecutor($vk, $access_token, $group_id, $handler, $wait); $executor->listen(); ``` Parameter **wait** is the waiting period. While calling function **listen()** you can also specify the number of the event from which you want to receive data. The default value is the number of the last event. Example: ```php $vk = new \VK\Client\VKApiClient(); $access_token = 'asdj4iht2i4ntokqngoiqn3ripogqr'; $group_id = 159895463; $timestamp = 12; $wait = 25; $executor = new \VK\CallbackApi\VKCallbackApiLongPollExecutor($vk, $access_token, $group_id, $handler, $wait); $executor->listen($timestamp); ``` ### 6.2. Callback API CallbackApi handler will wait for event notifications form VK. Once an event has occurred, you will be notified of it and will be able to handle it. More information [here](https://vk.com/dev/callback_api). To start using Callback API you need to configure it under the "Manage community" tab of your community page. The first step is confirming your domain. VK sends a request to your server with the event type **confirmation** and you need to send back a confirmation string. For other types of events you need to send back `ok` string. Take a look at this example: ```php class ServerHandler extends \VK\CallbackApi\VKCallbackApiServerHandler { const SECRET = 'ab12aba'; const GROUP_ID = 123999; const CONFIRMATION_TOKEN = 'e67anm1'; function confirmation(int $group_id, ?string $secret) { if ($secret === static::SECRET && $group_id === static::GROUP_ID) { echo static::CONFIRMATION_TOKEN; } } public function messageNew(int $group_id, ?string $secret, array $object) { echo 'ok'; } } $handler = new ServerHandler(); $data = json_decode(file_get_contents('php://input')); $handler->parse($data); ``` To handle events you need to override methods from VK\CallbackApi\Server\VKCallbackApiServerHandler class as shown above. `confirmation` event handler has 2 arguments: group id, and secret key. You need to override this method. ================================================ FILE: composer.json ================================================ { "name": "vkcom/vk-php-sdk", "version": "5.199.0", "description": "VK PHP SDK", "keywords": [ "vk", "sdk" ], "type": "library", "homepage": "https://github.com/VKCOM/vk-api-schema", "license": "MIT", "require": { "php": "^7|^8", "guzzlehttp/guzzle": "^7.5" }, "autoload": { "psr-4": { "VK\\": "src/VK" } }, "minimum-stability": "dev" } ================================================ FILE: examples/oauth/group.php ================================================ getAuthorizeUrl($authParams); echo '1. Copy and paste into your browser\'s address bar and press Enter: ' . $auth->getAuthorizeUrl($authParams) . "\n"; echo "2. Login\n"; echo "3. Copy url from the address bar\n"; echo "4. Paste this option below\n\n"; echo 'url > '; $handle = fopen ('php://stdin','r'); $url = fgets($handle); fclose($handle); $query = parse_url($url, PHP_URL_QUERY); if (empty($query)) { echo "[err] empty query in url\n"; exit(1); } parse_str($query, $q); if (empty($q['code'])) { echo "[err] not found parameter code in url\n"; exit(1); } $tokenParams = new AccessTokenParams($clientId, $clientSecret, $redirectUri, $q['code']); $token = $auth->getAccessToken($tokenParams); echo "token: " . $token['access_token'] . "\n\n"; ================================================ FILE: examples/oauth/user.php ================================================ setScope([Scopes::EMAIL, Scopes::PHONE]); $authUrl = $auth->getAuthorizeUrl($authParams); echo '1. Copy and paste into your browser\'s address bar and press Enter: ' . $auth->getAuthorizeUrl($authParams) . "\n"; echo "2. Login\n"; echo "3. Copy url from the address bar\n"; echo "4. Paste this option below\n\n"; echo 'url > '; $handle = fopen ('php://stdin','r'); $url = fgets($handle); fclose($handle); $query = parse_url($url, PHP_URL_QUERY); if (empty($query)) { echo "[err] empty query in url\n"; exit(1); } parse_str($query, $q); if (empty($q['code'])) { echo "[err] not found parameter code in url\n"; exit(1); } if (empty($q['device_id'])) { echo "[err] not found parameter device_id in url\n"; exit(1); } if (empty($q['state'])) { echo "[err] not found parameter state in url\n"; exit(1); } if ($q['state'] !== $state) { echo "[err] invalid state value in url, expect {$state}: {$q['state']}\n"; exit(1); } echo "code: " . $q['code'] . "\n"; echo "device_id: " . $q['device_id'] . "\n\n"; $tokenParams = new TokensParams($clientId, $verifier, $redirectUri, $q['code'], $q['device_id']); $token = $auth->getTokens($tokenParams); echo "refresh_token: " . $token['refresh_token'] . "\n"; echo "access_token: " . $token['access_token'] . "\n"; echo "id_token: " . $token['id_token'] . "\n"; echo "token type: " . $token['token_type'] . "\n"; ================================================ FILE: phpunit.xml ================================================ tests ================================================ FILE: src/VK/Actions/Account.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function ban(string $access_token, array $params = []) { return $this->request->post('account.ban', $access_token, $params); } /** * Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] method. * @param string $access_token * @param array $params * - @var string restore_sid: Session id received after the [vk.com/dev/auth.restore|auth.restore] method is executed. (If the password is changed right after the access was restored) * - @var string change_password_hash: Hash received after a successful OAuth authorization with a code got by SMS. (If the password is changed right after the access was restored) * - @var string old_password: Current user password. * - @var string new_password: New password that will be set as a current * @return mixed * @throws VKClientException * @throws VKApiException */ public function changePassword(string $access_token, array $params = []) { return $this->request->post('account.changePassword', $access_token, $params); } /** * Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes to his balance in the application. * @param string $access_token * @param array $params * - @var integer offset * - @var integer count: Number of results to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getActiveOffers(string $access_token, array $params = []) { return $this->request->post('account.getActiveOffers', $access_token, $params); } /** * Gets settings of the user in this application. * @param string $access_token * @param array $params * - @var integer user_id: User ID whose settings information shall be got. By default: current user. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAppPermissions(string $access_token, array $params = []) { return $this->request->post('account.getAppPermissions', $access_token, $params); } /** * Returns a user's blacklist. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of results to return. * - @var array[AccountGetBannedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getBanned(string $access_token, array $params = []) { return $this->request->post('account.getBanned', $access_token, $params); } /** * Returns non-null values of user counters. * @param string $access_token * @param array $params * - @var array[AccountGetCountersFilter] filter: Counters to be returned. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCounters(string $access_token, array $params = []) { return $this->request->post('account.getCounters', $access_token, $params); } /** * Returns current account info. * @param string $access_token * @param array $params * - @var array[AccountGetInfoFields] fields: Fields to return. Possible values: *'country' - user country,, *'https_required' - is "HTTPS only" option enabled,, *'own_posts_default' - is "Show my posts only" option is enabled,, *'no_wall_replies' - are wall replies disabled or not,, *'intro' - is intro passed by user or not,, *'lang' - user language. By default: all. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getInfo(string $access_token, array $params = []) { return $this->request->post('account.getInfo', $access_token, $params); } /** * Returns the current account info. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getProfileInfo(string $access_token) { return $this->request->post('account.getProfileInfo', $access_token); } /** * Gets settings of push notifications. * @param string $access_token * @param array $params * - @var string device_id: Unique device ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getPushSettings(string $access_token, array $params = []) { return $this->request->post('account.getPushSettings', $access_token, $params); } /** * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications * @param string $access_token * @param array $params * - @var string token: Device token used to send notifications. (for mpns, the token shall be URL for sending of notifications) * - @var string device_model: String name of device model. * - @var integer device_year: Device year. * - @var string device_id: Unique device ID. * - @var string system_version: String version of device operating system. * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. * - @var boolean sandbox * - @var boolean pushes_granted * @return mixed * @throws VKClientException * @throws VKApiException */ public function registerDevice(string $access_token, array $params = []) { return $this->request->post('account.registerDevice', $access_token, $params); } /** * Edits current profile info. * @param string $access_token * @param array $params * - @var string first_name: User first name. * - @var string last_name: User last name. * - @var string maiden_name: User maiden name (female only) * - @var string screen_name: User screen name. * - @var integer cancel_request_id: ID of the name change request to be canceled. If this parameter is sent, all the others are ignored. * - @var AccountSaveProfileInfoSex sex: User sex. Possible values: , * '1' - female,, * '2' - male. * - @var AccountSaveProfileInfoRelation relation: User relationship status. Possible values: , * '1' - single,, * '2' - in a relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - actively searching,, * '7' - in love,, * '0' - not specified. * - @var integer relation_partner_id: ID of the relationship partner. * - @var string bdate: User birth date, format: DD.MM.YYYY. * - @var AccountSaveProfileInfoBdateVisibility bdate_visibility: Birth date visibility. Returned values: , * '1' - show birth date,, * '2' - show only month and day,, * '0' - hide birth date. * - @var string home_town: User home town. * - @var integer country_id: User country. * - @var integer city_id: User city. * - @var string status: Status text. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiInvalidAddressException Invalid screen name */ public function saveProfileInfo(string $access_token, array $params = []) { return $this->request->post('account.saveProfileInfo', $access_token, $params); } /** * Allows to edit the current account info. * @param string $access_token * @param array $params * - @var AccountSetInfoName name: Setting name. * - @var string value: Setting value. * @return mixed * @throws VKClientException * @throws VKApiException */ public function setInfo(string $access_token, array $params = []) { return $this->request->post('account.setInfo', $access_token, $params); } /** * Marks a current user as offline. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function setOffline(string $access_token) { return $this->request->post('account.setOffline', $access_token); } /** * Marks the current user as online for 15 minutes. * @param string $access_token * @param array $params * - @var boolean voip: '1' if videocalls are available for current device. * @return mixed * @throws VKClientException * @throws VKApiException */ public function setOnline(string $access_token, array $params = []) { return $this->request->post('account.setOnline', $access_token, $params); } /** * Change push settings. * @param string $access_token * @param array $params * - @var string device_id: Unique device ID. * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. * - @var string key: Notification key. * - @var array[string] value: New value for the key in a [vk.com/dev/push_settings|special format]. * @return mixed * @throws VKClientException * @throws VKApiException */ public function setPushSettings(string $access_token, array $params = []) { return $this->request->post('account.setPushSettings', $access_token, $params); } /** * Mutes push notifications for the set period of time. * @param string $access_token * @param array $params * - @var string device_id: Unique device ID. * - @var integer time: Time in seconds for what notifications should be disabled. '-1' to disable forever. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " * - @var integer sound: '1' - to enable sound in this dialog, '0' - to disable sound. Only if 'peer_id' contains user or community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function setSilenceMode(string $access_token, array $params = []) { return $this->request->post('account.setSilenceMode', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function unban(string $access_token, array $params = []) { return $this->request->post('account.unban', $access_token, $params); } /** * Unsubscribes a device from push notifications. * @param string $access_token * @param array $params * - @var string device_id: Unique device ID. * - @var boolean sandbox * @return mixed * @throws VKClientException * @throws VKApiException */ public function unregisterDevice(string $access_token, array $params = []) { return $this->request->post('account.unregisterDevice', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Ads.php ================================================ request = $request; } /** * Adds managers and/or supervisors to advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function addOfficeUsers(string $access_token, array $params = []) { return $this->request->post('ads.addOfficeUsers', $access_token, $params); } /** * Allows to check the ad link. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var AdsCheckLinkLinkType link_type: Object type: *'community' - community,, *'post' - community post,, *'application' - VK application,, *'video' - video,, *'site' - external site. * - @var string link_url: Object URL. * - @var integer campaign_id: Campaign ID * @return mixed * @throws VKClientException * @throws VKApiException */ public function checkLink(string $access_token, array $params = []) { return $this->request->post('ads.checkLink', $access_token, $params); } /** * Creates ads. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe created ads. Description of 'ad_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function createAds(string $access_token, array $params = []) { return $this->request->post('ads.createAds', $access_token, $params); } /** * Creates advertising campaigns. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'campaign_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function createCampaigns(string $access_token, array $params = []) { return $this->request->post('ads.createCampaigns', $access_token, $params); } /** * Creates clients of an advertising agency. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'client_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function createClients(string $access_token, array $params = []) { return $this->request->post('ads.createClients', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var string source_type * - @var integer retargeting_group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. * @throws VKApiAdsLookalikeRequestAlreadyInProgressException Lookalike request with same source already in progress * @throws VKApiAdsLookalikeRequestMaxCountPerDayReachedException Max count of lookalike requests per day reached * @throws VKApiAdsLookalikeRequestAudienceTooLargeException Given audience is too large * @throws VKApiAdsLookalikeRequestAudienceTooSmallException Given audience is too small */ public function createLookalikeRequest(string $access_token, array $params = []) { return $this->request->post('ads.createLookalikeRequest', $access_token, $params); } /** * Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, registered, etc.). * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. * - @var string name: Name of the target group - a string up to 64 characters long. * - @var integer lifetime: 'For groups with auditory created with pixel code only.', , Number of days after that users will be automatically removed from the group. * - @var integer target_pixel_id * - @var string target_pixel_rules * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function createTargetGroup(string $access_token, array $params = []) { return $this->request->post('ads.createTargetGroup', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var string name * - @var string domain * - @var integer category_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function createTargetPixel(string $access_token, array $params = []) { return $this->request->post('ads.createTargetPixel', $access_token, $params); } /** * Archives ads. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string ids: Serialized JSON array with ad IDs. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsObjectDeletedException Object deleted * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function deleteAds(string $access_token, array $params = []) { return $this->request->post('ads.deleteAds', $access_token, $params); } /** * Archives advertising campaigns. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string ids: Serialized JSON array with IDs of deleted campaigns. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsObjectDeletedException Object deleted * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function deleteCampaigns(string $access_token, array $params = []) { return $this->request->post('ads.deleteCampaigns', $access_token, $params); } /** * Archives clients of an advertising agency. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string ids: Serialized JSON array with IDs of deleted clients. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsObjectDeletedException Object deleted * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function deleteClients(string $access_token, array $params = []) { return $this->request->post('ads.deleteClients', $access_token, $params); } /** * Deletes a retarget group. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. * - @var integer target_group_id: Group ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function deleteTargetGroup(string $access_token, array $params = []) { return $this->request->post('ads.deleteTargetGroup', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var integer target_pixel_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function deleteTargetPixel(string $access_token, array $params = []) { return $this->request->post('ads.deleteTargetPixel', $access_token, $params); } /** * Returns a list of advertising accounts. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAccounts(string $access_token) { return $this->request->post('ads.getAccounts', $access_token); } /** * Returns number of ads. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Available and required for advertising agencies.' ID of the client ads are retrieved from. * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown: *0 - show only active ads,, *1 - show all ads. * - @var boolean only_deleted: Flag that specifies whether to show only archived ads: *0 - show all ads,, *1 - show only archived ads. Available when include_deleted flag is *1 * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. * - @var integer limit: Limit of number of returned ads. Used only if ad_ids parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getAds(string $access_token, array $params = []) { return $this->request->post('ads.getAds', $access_token, $params); } /** * Returns descriptions of ad layouts. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 - show only active ads,, *1 - show all ads. * - @var boolean only_deleted: Flag that specifies whether to show only archived ads: *0 - show all ads,, *1 - show only archived ads. Available when include_deleted flag is *1 * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getAdsLayout(string $access_token, array $params = []) { return $this->request->post('ads.getAdsLayout', $access_token, $params); } /** * Returns ad targeting parameters. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. * - @var boolean include_deleted: flag that specifies whether archived ads shall be shown: *0 - show only active ads,, *1 - show all ads. * - @var boolean only_deleted * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. * - @var integer offset: Offset needed to return a specific subset of results. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getAdsTargeting(string $access_token, array $params = []) { return $this->request->post('ads.getAdsTargeting', $access_token, $params); } /** * Returns current budget of the advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getBudget(string $access_token, array $params = []) { return $this->request->post('ads.getBudget', $access_token, $params); } /** * Returns a list of campaigns in an advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'For advertising agencies'. ID of the client advertising campaigns are retrieved from. * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 - show only active campaigns,, *1 - show all campaigns. * - @var string campaign_ids: Filter of advertising campaigns to show. Serialized JSON array with campaign IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified advertising account will be shown. If the parameter is null, all campaigns will be shown. * - @var array[AdsGetCampaignsFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getCampaigns(string $access_token, array $params = []) { return $this->request->post('ads.getCampaigns', $access_token, $params); } /** * Returns a list of possible ad categories. * @param string $access_token * @param array $params * - @var string lang: Language. The full list of supported languages is [vk.com/dev/api_requests|here]. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCategories(string $access_token, array $params = []) { return $this->request->post('ads.getCategories', $access_token, $params); } /** * Returns a list of advertising agency's clients. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getClients(string $access_token, array $params = []) { return $this->request->post('ads.getClients', $access_token, $params); } /** * Returns demographics for ads or campaigns. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var AdsGetDemographicsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - campaigns. * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. * - @var AdsGetDemographicsPeriod period: Data grouping by dates: *day - statistics by days,, *month - statistics by months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary limits. * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created in,, *overall: 0. * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getDemographics(string $access_token, array $params = []) { return $this->request->post('ads.getDemographics', $access_token, $params); } /** * Returns information about current state of a counter - number of remaining runs of methods and time to the next counter nulling in seconds. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFloodStats(string $access_token, array $params = []) { return $this->request->post('ads.getFloodStats', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var string requests_ids * - @var integer offset * - @var integer limit * - @var string sort_by * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getLookalikeRequests(string $access_token, array $params = []) { return $this->request->post('ads.getLookalikeRequests', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string artist_name * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. * @throws VKApiNotFoundException Not found */ public function getMusicians(string $access_token, array $params = []) { return $this->request->post('ads.getMusicians', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] ids * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getMusiciansByIds(string $access_token, array $params = []) { return $this->request->post('ads.getMusiciansByIds', $access_token, $params); } /** * Returns a list of managers and supervisors of advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getOfficeUsers(string $access_token, array $params = []) { return $this->request->post('ads.getOfficeUsers', $access_token, $params); } /** * Returns detailed statistics of promoted posts reach from campaigns and ads. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var AdsGetPostsReachIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - campaigns. * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 100 objects. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getPostsReach(string $access_token, array $params = []) { return $this->request->post('ads.getPostsReach', $access_token, $params); } /** * Returns a reason of ad rejection for pre-moderation. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer ad_id: Ad ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getRejectionReason(string $access_token, array $params = []) { return $this->request->post('ads.getRejectionReason', $access_token, $params); } /** * Returns statistics of performance indicators for ads, campaigns, clients or the whole account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var AdsGetStatisticsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - campaigns,, *client - clients,, *office - account. * - @var string ids: IDs requested ads, campaigns, clients or account, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. * - @var AdsGetStatisticsPeriod period: Data grouping by dates: *day - statistics by days,, *month - statistics by months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary limits. * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created in,, *overall: 0. * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. * - @var array[AdsGetStatisticsStatsFields] stats_fields: Additional fields to add to statistics * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getStatistics(string $access_token, array $params = []) { return $this->request->post('ads.getStatistics', $access_token, $params); } /** * Returns a set of auto-suggestions for various targeting parameters. * @param string $access_token * @param array $params * - @var AdsGetSuggestionsSection section: Section, suggestions are retrieved in. Available values: *countries - request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions - requested list of regions. 'country' parameter is required. *cities - requested list of cities. 'country' parameter is required. *districts - requested list of districts. 'cities' parameter is required. *stations - requested list of subway stations. 'cities' parameter is required. *streets - requested list of streets. 'cities' parameter is required. *schools - requested list of educational organizations. 'cities' parameter is required. *interests - requested list of interests. *positions - requested list of positions (professions). *group_types - requested list of group types. *religions - requested list of religious commitments. *browsers - requested list of browsers and mobile devices. * - @var string ids: Objects IDs separated by commas. If the parameter is passed, 'q, country, cities' should not be passed. * - @var string q: Filter-line of the request (for countries, regions, cities, streets, schools, interests, positions). * - @var integer country: ID of the country objects are searched in. * - @var string cities: IDs of cities where objects are searched in, separated with a comma. * - @var BaseLang lang: Language of the returned string values. Supported languages: *ru - Russian,, *ua - Ukrainian,, *en - English. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSuggestions(string $access_token, array $params = []) { return $this->request->post('ads.getSuggestions', $access_token, $params); } /** * Returns a list of target groups. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. * - @var boolean extended: '1' - to return pixel code. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getTargetGroups(string $access_token, array $params = []) { return $this->request->post('ads.getTargetGroups', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getTargetPixels(string $access_token, array $params = []) { return $this->request->post('ads.getTargetPixels', $access_token, $params); } /** * Returns the size of targeting audience, and also recommended values for CPC and CPM. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id * - @var string criteria: Serialized JSON object that describes targeting parameters. Description of 'criteria' object see below. * - @var integer ad_id: ID of an ad which targeting parameters shall be analyzed. * - @var AdsGetTargetingStatsAdFormat ad_format: Ad format. Possible values: *'1' - image and text,, *'2' - big image,, *'3' - exclusive format,, *'4' - community, square image,, *'7' - special app format,, *'8' - special community format,, *'9' - post in community,, *'10' - app board. * - @var string ad_platform: Platforms to use for ad showing. Possible values: (for 'ad_format' = '1'), *'0' - VK and partner sites,, *'1' - VK only. (for 'ad_format' = '9'), *'all' - all platforms,, *'desktop' - desktop version,, *'mobile' - mobile version and apps. * - @var string ad_platform_no_wall * - @var string ad_platform_no_ad_network * - @var string publisher_platforms * - @var string link_url: URL for the advertised object. * - @var string link_domain: Domain of the advertised object. * - @var boolean need_precise: Additionally return recommended cpc and cpm to reach 5,10..95 percents of audience. * - @var integer impressions_limit_period: Impressions limit period in seconds, must be a multiple of 86400(day) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function getTargetingStats(string $access_token, array $params = []) { return $this->request->post('ads.getTargetingStats', $access_token, $params); } /** * Returns URL to upload an ad photo to. * @param string $access_token * @param array $params * - @var AdsGetUploadURLAdFormat ad_format: Ad format: *1 - image and text,, *2 - big image,, *3 - exclusive format,, *4 - community, square image,, *7 - special app format. * - @var integer icon * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUploadURL(string $access_token, array $params = []) { return $this->request->post('ads.getUploadURL', $access_token, $params); } /** * Returns URL to upload an ad video to. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getVideoUploadURL(string $access_token) { return $this->request->post('ads.getVideoUploadURL', $access_token); } /** * Imports a list of advertiser's contacts to count VK registered users against the target group. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. * - @var integer target_group_id: Target group ID. * - @var string contacts: List of phone numbers, emails or user IDs separated with a comma. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function importTargetContacts(string $access_token, array $params = []) { return $this->request->post('ads.importTargetContacts', $access_token, $params); } /** * Removes managers and/or supervisors from advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string ids: Serialized JSON array with IDs of deleted managers. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function removeOfficeUsers(string $access_token, array $params = []) { return $this->request->post('ads.removeOfficeUsers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var integer target_group_id * - @var string contacts * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function removeTargetContacts(string $access_token, array $params = []) { return $this->request->post('ads.removeTargetContacts', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var integer request_id * - @var integer level * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. * @throws VKApiAdsLookalikeRequestExportAlreadyInProgressException Lookalike request audience save already in progress * @throws VKApiAdsLookalikeRequestExportMaxCountPerDayReachedException Max count of lookalike request audience saves per day reached * @throws VKApiAdsLookalikeRequestExportRetargetingGroupLimitException Max count of retargeting groups reached */ public function saveLookalikeRequestResult(string $access_token, array $params = []) { return $this->request->post('ads.saveLookalikeRequestResult', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var integer target_group_id * - @var integer share_with_client_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function shareTargetGroup(string $access_token, array $params = []) { return $this->request->post('ads.shareTargetGroup', $access_token, $params); } /** * Edits ads. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe changes in ads. Description of 'ad_edit_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateAds(string $access_token, array $params = []) { return $this->request->post('ads.updateAds', $access_token, $params); } /** * Edits advertising campaigns. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe changes in campaigns. Description of 'campaign_mod' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateCampaigns(string $access_token, array $params = []) { return $this->request->post('ads.updateCampaigns', $access_token, $params); } /** * Edits clients of an advertising agency. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe changes in clients. Description of 'client_mod' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateClients(string $access_token, array $params = []) { return $this->request->post('ads.updateClients', $access_token, $params); } /** * Adds managers and/or supervisors to advertising account. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var string data: Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateOfficeUsers(string $access_token, array $params = []) { return $this->request->post('ads.updateOfficeUsers', $access_token, $params); } /** * Edits a retarget group. * @param string $access_token * @param array $params * - @var integer account_id: Advertising account ID. * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. * - @var integer target_group_id: Group ID. * - @var string name: New name of the target group - a string up to 64 characters long. * - @var string domain: Domain of the site where user accounting code will be placed. * - @var integer lifetime: 'Only for the groups that get audience from sites with user accounting code.', Time in days when users added to a retarget group will be automatically excluded from it. '0' - automatic exclusion is off. * - @var integer target_pixel_id * - @var string target_pixel_rules * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateTargetGroup(string $access_token, array $params = []) { return $this->request->post('ads.updateTargetGroup', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer account_id * - @var integer client_id * - @var integer target_pixel_id * - @var string name * - @var string domain * - @var integer category_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. */ public function updateTargetPixel(string $access_token, array $params = []) { return $this->request->post('ads.updateTargetPixel', $access_token, $params); } } ================================================ FILE: src/VK/Actions/AppWidgets.php ================================================ request = $request; } /** * Returns a URL for uploading a photo to the community collection for community app widgets * @param string $access_token * @param array $params * - @var AppWidgetsGetAppImageUploadServerImageType image_type * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAppImageUploadServer(string $access_token, array $params = []) { return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); } /** * Returns an app collection of images for community app widgets * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of images. * - @var integer count: Maximum count of results. * - @var AppWidgetsGetAppImagesImageType image_type * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAppImages(string $access_token, array $params = []) { return $this->request->post('appWidgets.getAppImages', $access_token, $params); } /** * Returns a URL for uploading a photo to the community collection for community app widgets * @param string $access_token * @param array $params * - @var AppWidgetsGetGroupImageUploadServerImageType image_type * @return mixed * @throws VKClientException * @throws VKApiException */ public function getGroupImageUploadServer(string $access_token, array $params = []) { return $this->request->post('appWidgets.getGroupImageUploadServer', $access_token, $params); } /** * Returns a community collection of images for community app widgets * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of images. * - @var integer count: Maximum count of results. * - @var AppWidgetsGetGroupImagesImageType image_type * @return mixed * @throws VKClientException * @throws VKApiException */ public function getGroupImages(string $access_token, array $params = []) { return $this->request->post('appWidgets.getGroupImages', $access_token, $params); } /** * Returns an image for community app widgets by its ID * @param string $access_token * @param array $params * - @var array[string] images: List of images IDs * @return mixed * @throws VKClientException * @throws VKApiException */ public function getImagesById(string $access_token, array $params = []) { return $this->request->post('appWidgets.getImagesById', $access_token, $params); } /** * Allows to save image into app collection for community app widgets * @param string $access_token * @param array $params * - @var string hash: Parameter returned when photo is uploaded to server * - @var string image: Parameter returned when photo is uploaded to server * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo */ public function saveAppImage(string $access_token, array $params = []) { return $this->request->post('appWidgets.saveAppImage', $access_token, $params); } /** * Allows to save image into community collection for community app widgets * @param string $access_token * @param array $params * - @var string hash: Parameter returned when photo is uploaded to server * - @var string image: Parameter returned when photo is uploaded to server * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo */ public function saveGroupImage(string $access_token, array $params = []) { return $this->request->post('appWidgets.saveGroupImage', $access_token, $params); } /** * Allows to update community app widget * @param string $access_token * @param array $params * - @var string code * - @var AppWidgetsUpdateType type * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiCompileException Unable to compile code * @throws VKApiBlockedException Content blocked * @throws VKApiWallAccessPostException Access to wall's post denied * @throws VKApiWallAccessRepliesException Access to post comments denied * @throws VKApiParamGroupIdException Invalid group id */ public function update(string $access_token, array $params = []) { return $this->request->post('appWidgets.update', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Apps.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var array[AppsAddSnippetVkRef] vk_ref * - @var array[integer] group_id * - @var array[string] hash * - @var integer snippet_id * - @var string title * - @var string description * - @var string image_url * - @var string small_image_url * - @var AppsAddSnippetButton button * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAppsEmptyFilterParamsException Empty filter params * @throws VKApiAppsEmptySnippetDataException Empty snippet data * @throws VKApiAppsTooManySnippetsException Too many snippets * @throws VKApiAppsNotFoundSnippetException Not found snippet */ public function addSnippet(string $access_token, array $params = []) { return $this->request->post('apps.addSnippet', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function addUsersToTestingGroup(string $access_token, array $params = []) { return $this->request->post('apps.addUsersToTestingGroup', $access_token, $params); } /** * Deletes all request notifications from the current app. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteAppRequests(string $access_token) { return $this->request->post('apps.deleteAppRequests', $access_token); } /** * @param string $access_token * @param array $params * - @var integer id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAppsNotFoundSnippetException Not found snippet */ public function deleteSnippet(string $access_token, array $params = []) { return $this->request->post('apps.deleteSnippet', $access_token, $params); } /** * Returns applications data. * @param string $access_token * @param array $params * - @var integer app_id: Application ID * - @var array[integer] app_ids: List of application ID * - @var AppsGetPlatform platform: platform. Possible values: *'ios' - iOS,, *'android' - Android,, *'winphone' - Windows Phone,, *'web' - приложения на vk.com. By default: 'web'. * - @var boolean extended * - @var boolean return_friends * - @var array[AppsGetFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', (only if return_friends - 1) * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default),, 'gen' - genitive,, 'dat' - dative,, 'acc' - accusative,, 'ins' - instrumental,, 'abl' - prepositional. (only if 'return_friends' = '1') * - @var array[AppsGetAppFields] app_fields: List of app fields to return. Fields 'id', 'type' and 'title' will always be in response. Leave this field empty to get all fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('apps.get', $access_token, $params); } /** * Returns a list of applications (apps) available to users in the App Catalog. * @param string $access_token * @param array $params * - @var AppsGetCatalogSort sort: Sort order: 'popular_today' - popular for one day (default), 'visitors' - by visitors number , 'create_date' - by creation date, 'growth_rate' - by growth rate, 'popular_week' - popular for one week * - @var integer offset: Offset required to return a specific subset of apps. * - @var integer count: Number of apps to return. * - @var string platform * - @var boolean extended: '1' - to return additional fields 'screenshots', 'MAU', 'catalog_position', and 'international'. If set, 'count' must be less than or equal to '100'. '0' - not to return additional fields (default). * - @var boolean return_friends * - @var array[AppsGetCatalogFields] fields * - @var NameCase name_case * - @var string q: Search query string. * - @var integer genre_id * - @var AppsGetCatalogFilter filter: 'installed' - to return list of installed apps (only for mobile platform). * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCatalog(string $access_token, array $params = []) { return $this->request->post('apps.getCatalog', $access_token, $params); } /** * Creates friends list for requests and invites in current app. * @param string $access_token * @param array $params * - @var boolean extended * - @var integer count: List size. * - @var integer offset * - @var AppsGetFriendsListType type: List type. Possible values: * 'invite' - available for invites (don't play the game),, * 'request' - available for request (play the game). By default: 'invite'. * - @var array[AppsGetFriendsListFields] fields: Additional profile fields, see [vk.com/dev/fields|description]. * - @var string query: Search query string (e.g., 'Vasya Babich'). * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFriendsList(string $access_token, array $params = []) { return $this->request->post('apps.getFriendsList', $access_token, $params); } /** * Returns players rating in the game. * @param string $access_token * @param array $params * - @var AppsGetLeaderboardType type: Leaderboard type. Possible values: *'level' - by level,, *'points' - by mission points,, *'score' - by score (). * - @var boolean global: Rating type. Possible values: *'1' - global rating among all players,, *'0' - rating among user friends. * - @var boolean extended: 1 - to return additional info about users * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLeaderboard(string $access_token, array $params = []) { return $this->request->post('apps.getLeaderboard', $access_token, $params); } /** * Returns policies and terms given to a mini app. * @param string $access_token * @param array $params * - @var integer app_id: Mini App ID * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMiniAppPolicies(string $access_token, array $params = []) { return $this->request->post('apps.getMiniAppPolicies', $access_token, $params); } /** * Returns scopes for auth * @param string $access_token * @param array $params * - @var AppsGetScopesType type * @return mixed * @throws VKClientException * @throws VKApiException */ public function getScopes(string $access_token, array $params = []) { return $this->request->post('apps.getScopes', $access_token, $params); } /** * Returns user score in app * @param string $access_token * @param array $params * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getScore(string $access_token, array $params = []) { return $this->request->post('apps.getScore', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSnippets(string $access_token) { return $this->request->post('apps.getSnippets', $access_token); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTestingGroups(string $access_token, array $params = []) { return $this->request->post('apps.getTestingGroups', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function isNotificationsAllowed(string $access_token, array $params = []) { return $this->request->post('apps.isNotificationsAllowed', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer promo_id: Id of game promo action * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiActionFailedException Unable to process action */ public function promoHasActiveGift(string $access_token, array $params = []) { return $this->request->post('apps.promoHasActiveGift', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer promo_id: Id of game promo action * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiActionFailedException Unable to process action */ public function promoUseGift(string $access_token, array $params = []) { return $this->request->post('apps.promoUseGift', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeTestingGroup(string $access_token, array $params = []) { return $this->request->post('apps.removeTestingGroup', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] user_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeUsersFromTestingGroups(string $access_token, array $params = []) { return $this->request->post('apps.removeUsersFromTestingGroups', $access_token, $params); } /** * Sends a request to another user in an app that uses VK authorization. * @param string $access_token * @param array $params * - @var integer user_id: id of the user to send a request * - @var string text: request text * - @var AppsSendRequestType type: request type. Values: 'invite' - if the request is sent to a user who does not have the app installed,, 'request' - if a user has already installed the app * - @var string name * - @var string key: special string key to be sent with the request * - @var boolean separate * @return mixed * @throws VKClientException * @throws VKApiException */ public function sendRequest(string $access_token, array $params = []) { return $this->request->post('apps.sendRequest', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var string webview * - @var string name * - @var array[AppsUpdateMetaForTestingGroupPlatforms] platforms * - @var array[integer] user_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function updateMetaForTestingGroup(string $access_token, array $params = []) { return $this->request->post('apps.updateMetaForTestingGroup', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Auth.php ================================================ request = $request; } /** * Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. " * @param string $access_token * @param array $params * - @var string phone: User phone number. * - @var string last_name: User last name. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAuthFloodException Too many auth attempts, try again later */ public function restore(string $access_token, array $params = []) { return $this->request->post('auth.restore', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Board.php ================================================ request = $request; } /** * Creates a new topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var string title: Topic title. * - @var string text: Text of the topic. * - @var boolean from_group: For a community: '1' - to post the topic as by the community, '0' - to post the topic as by the user (default) * - @var array[string] attachments: List of media objects attached to the topic, in the following format: "_,_", '' - Type of media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. '' - Media ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you try to attach more than one reference, an error will be thrown.", * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function addTopic(string $access_token, array $params = []) { return $this->request->post('board.addTopic', $access_token, $params); } /** * Closes a topic on a community's discussion board so that comments cannot be posted. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function closeTopic(string $access_token, array $params = []) { return $this->request->post('board.closeTopic', $access_token, $params); } /** * Adds a comment on a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: ID of the topic to be commented on. * - @var string message: (Required if 'attachments' is not set.) Text of the comment. * - @var array[string] attachments: (Required if 'text' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' - Type of media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. '' - Media ID. * - @var boolean from_group: '1' - to post the comment as by the community, '0' - to post the comment as by the user (default) * - @var integer sticker_id: Sticker ID. * - @var string guid: Unique identifier to avoid repeated comments. * @return mixed * @throws VKClientException * @throws VKApiException */ public function createComment(string $access_token, array $params = []) { return $this->request->post('board.createComment', $access_token, $params); } /** * Deletes a comment on a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * - @var integer comment_id: Comment ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('board.deleteComment', $access_token, $params); } /** * Deletes a topic from a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteTopic(string $access_token, array $params = []) { return $this->request->post('board.deleteTopic', $access_token, $params); } /** * Edits a comment on a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * - @var integer comment_id: ID of the comment on the topic. * - @var string message: (Required if 'attachments' is not set). New comment text. * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' - Type of media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. '' - Media ID. Example: "photo100172_166443618,photo66748_265827614" * @return mixed * @throws VKClientException * @throws VKApiException */ public function editComment(string $access_token, array $params = []) { return $this->request->post('board.editComment', $access_token, $params); } /** * Edits the title of a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * - @var string title: New title of the topic. * @return mixed * @throws VKClientException * @throws VKApiException */ public function editTopic(string $access_token, array $params = []) { return $this->request->post('board.editTopic', $access_token, $params); } /** * Pins a topic (fixes its place) to the top of a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function fixTopic(string $access_token, array $params = []) { return $this->request->post('board.fixTopic', $access_token, $params); } /** * Returns a list of comments on a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * - @var boolean need_likes: '1' - to return the 'likes' field, '0' - not to return the 'likes' field (default) * - @var integer start_comment_id * - @var integer offset: Offset needed to return a specific subset of comments. * - @var integer count: Number of comments to return. * - @var boolean extended: '1' - to return information about users who posted comments, '0' - to return no additional fields (default) * - @var BoardGetCommentsSort sort: Sort order: 'asc' - by creation date in chronological order, 'desc' - by creation date in reverse chronological order, * @return mixed * @throws VKClientException * @throws VKApiException */ public function getComments(string $access_token, array $params = []) { return $this->request->post('board.getComments', $access_token, $params); } /** * Returns a list of topics on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var array[integer] topic_ids: IDs of topics to be returned (100 maximum). By default, all topics are returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. * - @var BoardGetTopicsOrder order: Sort order: '1' - by date updated in reverse chronological order. '2' - by date created in reverse chronological order. '-1' - by date updated in chronological order. '-2' - by date created in chronological order. If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting. * - @var integer offset: Offset needed to return a specific subset of topics. * - @var integer count: Number of topics to return. * - @var boolean extended: '1' - to return information about users who created topics or who posted there last, '0' - to return no additional fields (default) * - @var BoardGetTopicsPreview preview: '1' - to return the first comment in each topic,, '2' - to return the last comment in each topic,, '0' - to return no comments. By default: '0'. * - @var integer preview_length: Number of characters after which to truncate the previewed comment. To preview the full comment, specify '0'. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTopics(string $access_token, array $params = []) { return $this->request->post('board.getTopics', $access_token, $params); } /** * Re-opens a previously closed topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function openTopic(string $access_token, array $params = []) { return $this->request->post('board.openTopic', $access_token, $params); } /** * Restores a comment deleted from a topic on a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * - @var integer comment_id: Comment ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('board.restoreComment', $access_token, $params); } /** * Unpins a pinned topic from the top of a community's discussion board. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the discussion board. * - @var integer topic_id: Topic ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function unfixTopic(string $access_token, array $params = []) { return $this->request->post('board.unfixTopic', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Bugtracker.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer company_id * - @var array[integer] user_ids * - @var array[integer] company_group_ids * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function addCompanyGroupsMembers(string $access_token, array $params = []) { return $this->request->post('bugtracker.addCompanyGroupsMembers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var integer company_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function addCompanyMembers(string $access_token, array $params = []) { return $this->request->post('bugtracker.addCompanyMembers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer bugreport_id * - @var integer status * - @var string comment * - @var array[integer] from_statuses * - @var array[integer] not_in_statuses * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiActionFailedException Unable to process action */ public function changeBugreportStatus(string $access_token, array $params = []) { return $this->request->post('bugtracker.changeBugreportStatus', $access_token, $params); } /** * Creates the comment to bugreport * @param string $access_token * @param array $params * - @var integer bugreport_id * - @var string text * - @var boolean hidden * - @var boolean hidden_attachments * - @var boolean force * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiParamPhotosException Invalid photos */ public function createComment(string $access_token, array $params = []) { return $this->request->post('bugtracker.createComment', $access_token, $params); } /** * Returns extended bugreport data * @param string $access_token * @param array $params * - @var integer bugreport_id * - @var boolean extended * - @var array[BugtrackerGetBugreportByIdFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function getBugreportById(string $access_token, array $params = []) { return $this->request->post('bugtracker.getBugreportById', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer company_id * - @var integer company_group_id * - @var integer count * - @var integer offset * - @var string filter_name * - @var boolean extended * - @var array[BugtrackerGetCompanyGroupMembersFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function getCompanyGroupMembers(string $access_token, array $params = []) { return $this->request->post('bugtracker.getCompanyGroupMembers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer company_id * - @var integer count * - @var integer offset * - @var string filter_name * - @var BugtrackerGetCompanyMembersFilterRole filter_role * - @var integer filter_not_group * - @var array[integer] filter_member_ids * - @var boolean extended * - @var array[BugtrackerGetCompanyMembersFields] fields * - @var boolean extra * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function getCompanyMembers(string $access_token, array $params = []) { return $this->request->post('bugtracker.getCompanyMembers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer product_id * - @var integer version_id * - @var integer ttl * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiActionFailedException Unable to process action */ public function getDownloadVersionUrl(string $access_token, array $params = []) { return $this->request->post('bugtracker.getDownloadVersionUrl', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer product_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getProductBuildUploadServer(string $access_token, array $params = []) { return $this->request->post('bugtracker.getProductBuildUploadServer', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer company_id * - @var integer user_id * - @var integer company_group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function removeCompanyGroupMember(string $access_token, array $params = []) { return $this->request->post('bugtracker.removeCompanyGroupMember', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer company_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function removeCompanyMember(string $access_token, array $params = []) { return $this->request->post('bugtracker.removeCompanyMember', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer product_id * - @var integer version_id * - @var string title * - @var string release_notes * - @var boolean visible * - @var boolean set_rft * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function saveProductVersion(string $access_token, array $params = []) { return $this->request->post('bugtracker.saveProductVersion', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer company_id * - @var BugtrackerSetCompanyMemberRoleRole role * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiLimitsException Out of limits */ public function setCompanyMemberRole(string $access_token, array $params = []) { return $this->request->post('bugtracker.setCompanyMemberRole', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer product_id * - @var boolean is_over * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiActionFailedException Unable to process action */ public function setProductIsOver(string $access_token, array $params = []) { return $this->request->post('bugtracker.setProductIsOver', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Calls.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var string call_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function forceFinish(string $access_token, array $params = []) { return $this->request->post('calls.forceFinish', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function start(string $access_token, array $params = []) { return $this->request->post('calls.start', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Database.php ================================================ request = $request; } /** * Returns list of chairs on a specified faculty. * @param string $access_token * @param array $params * - @var integer faculty_id: id of the faculty to get chairs from * - @var integer offset: offset required to get a certain subset of chairs * - @var integer count: amount of chairs to get * @return mixed * @throws VKClientException * @throws VKApiException */ public function getChairs(string $access_token, array $params = []) { return $this->request->post('database.getChairs', $access_token, $params); } /** * Returns a list of cities. * @param string $access_token * @param array $params * - @var integer region_id: Region ID. * - @var string q: Search query. * - @var boolean need_all: '1' - to return all cities in the country, '0' - to return major cities in the country (default), * - @var integer offset: Offset needed to return a specific subset of cities. * - @var integer count: Number of cities to return. * - @var array[string] fields: Cities fields to return. Sample values: 'fias_guid' * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCities(string $access_token, array $params = []) { return $this->request->post('database.getCities', $access_token, $params); } /** * Returns information about cities by their IDs. * @param string $access_token * @param array $params * - @var array[integer] city_ids: City IDs. * - @var array[string] fields: Cities fields to return. Sample values: 'fias_guid' * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCitiesById(string $access_token, array $params = []) { return $this->request->post('database.getCitiesById', $access_token, $params); } /** * Returns a list of countries. * @param string $access_token * @param array $params * - @var boolean need_all: '1' - to return a full list of all countries, '0' - to return a list of countries near the current user's country (default). * - @var string code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. * - @var integer offset: Offset needed to return a specific subset of countries. * - @var integer count: Number of countries to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCountries(string $access_token, array $params = []) { return $this->request->post('database.getCountries', $access_token, $params); } /** * Returns information about countries by their IDs. * @param string $access_token * @param array $params * - @var array[integer] country_ids: Country IDs. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCountriesById(string $access_token, array $params = []) { return $this->request->post('database.getCountriesById', $access_token, $params); } /** * Returns a list of faculties (i.e., university departments). * @param string $access_token * @param array $params * - @var integer university_id: University ID. * - @var integer offset: Offset needed to return a specific subset of faculties. * - @var integer count: Number of faculties to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFaculties(string $access_token, array $params = []) { return $this->request->post('database.getFaculties', $access_token, $params); } /** * Get metro stations by city * @param string $access_token * @param array $params * - @var integer city_id * - @var integer offset * - @var integer count * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMetroStations(string $access_token, array $params = []) { return $this->request->post('database.getMetroStations', $access_token, $params); } /** * Get metro station by his id * @param string $access_token * @param array $params * - @var array[integer] station_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMetroStationsById(string $access_token, array $params = []) { return $this->request->post('database.getMetroStationsById', $access_token, $params); } /** * Returns a list of regions. * @param string $access_token * @param array $params * - @var string q: Search query. * - @var integer offset: Offset needed to return specific subset of regions. * - @var integer count: Number of regions to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getRegions(string $access_token, array $params = []) { return $this->request->post('database.getRegions', $access_token, $params); } /** * Returns a list of school classes specified for the country. * @param string $access_token * @param array $params * - @var integer country_id: Country ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSchoolClasses(string $access_token, array $params = []) { return $this->request->post('database.getSchoolClasses', $access_token, $params); } /** * Returns a list of schools. * @param string $access_token * @param array $params * - @var string q: Search query. * - @var integer city_id: City ID. * - @var integer offset: Offset needed to return a specific subset of schools. * - @var integer count: Number of schools to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSchools(string $access_token, array $params = []) { return $this->request->post('database.getSchools', $access_token, $params); } /** * Returns a list of higher education institutions. * @param string $access_token * @param array $params * - @var string q: Search query. * - @var integer city_id: City ID. * - @var integer offset: Offset needed to return a specific subset of universities. * - @var integer count: Number of universities to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUniversities(string $access_token, array $params = []) { return $this->request->post('database.getUniversities', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Docs.php ================================================ request = $request; } /** * Copies a document to a user's or community's document list. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. * - @var integer doc_id: Document ID. * - @var string access_key: Access key. This parameter is required if 'access_key' was returned with the document's data. * @return mixed * @throws VKClientException * @throws VKApiException */ public function add(string $access_token, array $params = []) { return $this->request->post('docs.add', $access_token, $params); } /** * Deletes a user or community document. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. * - @var integer doc_id: Document ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamDocDeleteAccessException Access to document deleting is denied * @throws VKApiParamDocIdException Invalid document id */ public function delete(string $access_token, array $params = []) { return $this->request->post('docs.delete', $access_token, $params); } /** * Edits a document. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer doc_id: Document ID. * - @var string title: Document title. * - @var array[string] tags: Document tags. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamDocAccessException Access to document is denied * @throws VKApiParamDocIdException Invalid document id * @throws VKApiParamDocTitleException Invalid document title */ public function edit(string $access_token, array $params = []) { return $this->request->post('docs.edit', $access_token, $params); } /** * Returns detailed information about user or community documents. * @param string $access_token * @param array $params * - @var integer count: Number of documents to return. By default, all documents. * - @var integer offset: Offset needed to return a specific subset of documents. * - @var DocsGetType type * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. * - @var boolean return_tags * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('docs.get', $access_token, $params); } /** * Returns information about documents by their IDs. * @param string $access_token * @param array $params * - @var array[string] docs: Document IDs. Example: , "66748_91488,66748_91455", * - @var boolean return_tags * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('docs.getById', $access_token, $params); } /** * Returns the server address for document upload. * @param string $access_token * @param array $params * - @var DocsGetMessagesUploadServerType type: Document type. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesDenySendException Can't send messages for users without permission */ public function getMessagesUploadServer(string $access_token, array $params = []) { return $this->request->post('docs.getMessagesUploadServer', $access_token, $params); } /** * Returns documents types available for current user. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTypes(string $access_token, array $params = []) { return $this->request->post('docs.getTypes', $access_token, $params); } /** * Returns the server address for document upload. * @param string $access_token * @param array $params * - @var integer group_id: Community ID (if the document will be uploaded to the community). * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUploadServer(string $access_token, array $params = []) { return $this->request->post('docs.getUploadServer', $access_token, $params); } /** * Returns the server address for document upload onto a user's or community's wall. * @param string $access_token * @param array $params * - @var integer group_id: Community ID (if the document will be uploaded to the community). * @return mixed * @throws VKClientException * @throws VKApiException */ public function getWallUploadServer(string $access_token, array $params = []) { return $this->request->post('docs.getWallUploadServer', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer doc_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamDocRestoreAccessException Access to document restoring is denied * @throws VKApiParamDocRestoreTimeoutException Document was deleted too long ago */ public function restore(string $access_token, array $params = []) { return $this->request->post('docs.restore', $access_token, $params); } /** * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. * @param string $access_token * @param array $params * - @var string file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the server]. * - @var string title: Document title. * - @var string tags: Document tags. * - @var boolean return_tags * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiSaveFileException Couldn't save file */ public function save(string $access_token, array $params = []) { return $this->request->post('docs.save', $access_token, $params); } /** * Returns a list of documents matching the search criteria. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var boolean search_own * - @var integer count: Number of results to return. * - @var integer offset: Offset needed to return a specific subset of results. * - @var boolean return_tags * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('docs.search', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Donut.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer offset * - @var integer count * - @var array[string] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFriends(string $access_token, array $params = []) { return $this->request->post('donut.getFriends', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getSubscription(string $access_token, array $params = []) { return $this->request->post('donut.getSubscription', $access_token, $params); } /** * Returns a list of user's VK Donut subscriptions. * @param string $access_token * @param array $params * - @var array[DonutGetSubscriptionsFields] fields * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSubscriptions(string $access_token, array $params = []) { return $this->request->post('donut.getSubscriptions', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function isDon(string $access_token, array $params = []) { return $this->request->post('donut.isDon', $access_token, $params); } } ================================================ FILE: src/VK/Actions/DownloadedGames.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiActionFailedException Unable to process action * @throws VKApiNotFoundException Not found */ public function getPaidStatus(string $access_token, array $params = []) { return $this->request->post('downloadedGames.getPaidStatus', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Execute.php ================================================ request = $request; } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiCompileException Unable to compile code */ public function execute(string $access_token) { return $this->request->post('execute.execute', $access_token); } } ================================================ FILE: src/VK/Actions/Fave.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var string url * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function addArticle(string $access_token, array $params = []) { return $this->request->post('fave.addArticle', $access_token, $params); } /** * Adds a link to user faves. * @param string $access_token * @param array $params * - @var string link: Link URL. * @return mixed * @throws VKClientException * @throws VKApiException */ public function addLink(string $access_token, array $params = []) { return $this->request->post('fave.addLink', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function addPage(string $access_token, array $params = []) { return $this->request->post('fave.addPage', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * - @var string access_key * @return mixed * @throws VKClientException * @throws VKApiException */ public function addPost(string $access_token, array $params = []) { return $this->request->post('fave.addPost', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * - @var string access_key * @return mixed * @throws VKClientException * @throws VKApiException */ public function addProduct(string $access_token, array $params = []) { return $this->request->post('fave.addProduct', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string name * - @var FaveAddTagPosition position * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function addTag(string $access_token, array $params = []) { return $this->request->post('fave.addTag', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * - @var string access_key * @return mixed * @throws VKClientException * @throws VKApiException */ public function addVideo(string $access_token, array $params = []) { return $this->request->post('fave.addVideo', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer id * - @var string name * @return mixed * @throws VKClientException * @throws VKApiException */ public function editTag(string $access_token, array $params = []) { return $this->request->post('fave.editTag', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var boolean extended: '1' - to return additional 'wall', 'profiles', and 'groups' fields. By default: '0'. * - @var FaveGetItemType item_type * - @var integer tag_id: Tag ID. * - @var integer offset: Offset needed to return a specific subset of users. * - @var integer count: Number of users to return. * - @var string fields * - @var boolean is_from_snackbar * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('fave.get', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer offset * - @var integer count * - @var FaveGetPagesType type * - @var array[FaveGetPagesFields] fields * - @var integer tag_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getPages(string $access_token, array $params = []) { return $this->request->post('fave.getPages', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTags(string $access_token) { return $this->request->post('fave.getTags', $access_token); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function markSeen(string $access_token) { return $this->request->post('fave.markSeen', $access_token); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer article_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeArticle(string $access_token, array $params = []) { return $this->request->post('fave.removeArticle', $access_token, $params); } /** * Removes link from the user's faves. * @param string $access_token * @param array $params * - @var string link_id: Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] method). * - @var string link: Link URL * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeLink(string $access_token, array $params = []) { return $this->request->post('fave.removeLink', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removePage(string $access_token, array $params = []) { return $this->request->post('fave.removePage', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removePost(string $access_token, array $params = []) { return $this->request->post('fave.removePost', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeProduct(string $access_token, array $params = []) { return $this->request->post('fave.removeProduct', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeTag(string $access_token, array $params = []) { return $this->request->post('fave.removeTag', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer id * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeVideo(string $access_token, array $params = []) { return $this->request->post('fave.removeVideo', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function reorderTags(string $access_token, array $params = []) { return $this->request->post('fave.reorderTags', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer group_id * - @var array[integer] tag_ids * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function setPageTags(string $access_token, array $params = []) { return $this->request->post('fave.setPageTags', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var FaveSetTagsItemType item_type * - @var integer item_owner_id * - @var integer item_id * - @var array[integer] tag_ids * - @var string link_id * - @var string link_url * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found * @throws VKApiFaveAliexpressTagException Can't set AliExpress tag to this type of object */ public function setTags(string $access_token, array $params = []) { return $this->request->post('fave.setTags', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function trackPageInteraction(string $access_token, array $params = []) { return $this->request->post('fave.trackPageInteraction', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Friends.php ================================================ request = $request; } /** * Approves or creates a friend request. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user whose friend request will be approved or to whom a friend request will be sent. * - @var string text: Text of the message (up to 500 characters) for the friend request, if any. * - @var boolean follow: '1' to pass an incoming request to followers list. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiFriendsAddInEnemyException Cannot add this user to friends as they have put you on their blacklist * @throws VKApiFriendsAddEnemyException Cannot add this user to friends as you put him on blacklist * @throws VKApiFriendsAddYourselfException Cannot add user himself as friend * @throws VKApiFriendsAddNotFoundException Cannot add this user to friends as user not found * @throws VKApiFriendsTooManyFriendsException Too many friends */ public function add(string $access_token, array $params = []) { return $this->request->post('friends.add', $access_token, $params); } /** * Creates a new friend list for the current user. * @param string $access_token * @param array $params * - @var string name: Name of the friend list. * - @var array[integer] user_ids: IDs of users to be added to the friend list. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiFriendsListLimitException Reached the maximum number of lists */ public function addList(string $access_token, array $params = []) { return $this->request->post('friends.addList', $access_token, $params); } /** * Checks the current user's friendship status with other specified users. * @param string $access_token * @param array $params * - @var array[integer] user_ids: IDs of the users whose friendship status to check. * - @var boolean need_sign: '1' - to return 'sign' field. 'sign' is md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This field allows to check that data has not been modified by the client. By default: '0'. * - @var boolean extended: Return friend request read_state field * @return mixed * @throws VKClientException * @throws VKApiException */ public function areFriends(string $access_token, array $params = []) { return $this->request->post('friends.areFriends', $access_token, $params); } /** * Declines a friend request or deletes a user from the current user's friend list. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user whose friend request is to be declined or who is to be deleted from the current user's friend list. * @return mixed * @throws VKClientException * @throws VKApiException */ public function delete(string $access_token, array $params = []) { return $this->request->post('friends.delete', $access_token, $params); } /** * Marks all incoming friend requests as viewed. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteAllRequests(string $access_token) { return $this->request->post('friends.deleteAllRequests', $access_token); } /** * Deletes a friend list of the current user. * @param string $access_token * @param array $params * - @var integer list_id: ID of the friend list to delete. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiFriendsListIdException Invalid list id */ public function deleteList(string $access_token, array $params = []) { return $this->request->post('friends.deleteList', $access_token, $params); } /** * Edits the friend lists of the selected user. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user whose friend list is to be edited. * - @var array[integer] list_ids: IDs of the friend lists to which to add the user. * @return mixed * @throws VKClientException * @throws VKApiException */ public function edit(string $access_token, array $params = []) { return $this->request->post('friends.edit', $access_token, $params); } /** * Edits a friend list of the current user. * @param string $access_token * @param array $params * - @var string name: Name of the friend list. * - @var integer list_id: Friend list ID. * - @var array[integer] user_ids: IDs of users in the friend list. * - @var array[integer] add_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to add to the friend list. * - @var array[integer] delete_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to delete from the friend list. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiFriendsListIdException Invalid list id */ public function editList(string $access_token, array $params = []) { return $this->request->post('friends.editList', $access_token, $params); } /** * Returns a list of user IDs or detailed information about a user's friends. * @param string $access_token * @param array $params * - @var integer user_id: User ID. By default, the current user ID. * - @var FriendsGetOrder order: Sort order: , 'name' - by name (enabled only if the 'fields' parameter is used), 'hints' - by rating, similar to how friends are sorted in My friends section, , This parameter is available only for [vk.com/dev/standalone|desktop applications]. * - @var integer list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] method to be used as the source. This parameter is taken into account only when the uid parameter is set to the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications]. * - @var integer count: Number of friends to return. * - @var integer offset: Offset needed to return a specific subset of friends. * - @var array[FriendsGetFields] fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'. * - @var string ref * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('friends.get', $access_token, $params); } /** * Returns a list of IDs of the current user's friends who installed the application. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAppUsers(string $access_token) { return $this->request->post('friends.getAppUsers', $access_token); } /** * Returns a list of the user's friend lists. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var boolean return_system: '1' - to return system friend lists. By default: '0'. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLists(string $access_token, array $params = []) { return $this->request->post('friends.getLists', $access_token, $params); } /** * Returns a list of user IDs of the mutual friends of two users. * @param string $access_token * @param array $params * - @var integer source_uid: ID of the user whose friends will be checked against the friends of the user specified in 'target_uid'. * - @var integer target_uid: ID of the user whose friends will be checked against the friends of the user specified in 'source_uid'. * - @var array[integer] target_uids: IDs of the users whose friends will be checked against the friends of the user specified in 'source_uid'. * - @var string order: Sort order: 'random' - random order * - @var integer count: Number of mutual friends to return. * - @var integer offset: Offset needed to return a specific subset of mutual friends. * - @var boolean need_common_count: Return mutual friends total count * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMutual(string $access_token, array $params = []) { return $this->request->post('friends.getMutual', $access_token, $params); } /** * Returns a list of user IDs of a user's friends who are online. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var integer list_id: Friend list ID. If this parameter is not set, information about all online friends is returned. * - @var boolean online_mobile: '1' - to return an additional 'online_mobile' field, '0' - (default), * - @var string order: Sort order: 'random' - random order * - @var integer count: Number of friends to return. * - @var integer offset: Offset needed to return a specific subset of friends. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getOnline(string $access_token, array $params = []) { return $this->request->post('friends.getOnline', $access_token, $params); } /** * Returns a list of user IDs of the current user's recently added friends. * @param string $access_token * @param array $params * - @var integer count: Number of recently added friends to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getRecent(string $access_token, array $params = []) { return $this->request->post('friends.getRecent', $access_token, $params); } /** * Returns information about the current user's incoming and outgoing friend requests. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of friend requests. * - @var integer count: Number of friend requests to return (default 100, maximum 1000). * - @var boolean extended: '1' - to return response messages from users who have sent a friend request or, if 'suggested' is set to '1', to return a list of suggested friends * - @var boolean need_mutual: '1' - to return a list of mutual friends (up to 20), if any * - @var boolean out: '1' - to return outgoing requests, '0' - to return incoming requests (default) * - @var FriendsGetRequestsSort sort: Sort order: '1' - by number of mutual friends, '0' - by date * - @var boolean need_viewed * - @var boolean suggested: '1' - to return a list of suggested friends, '0' - to return friend requests (default) * - @var string ref * - @var array[FriendsGetRequestsFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function getRequests(string $access_token, array $params = []) { return $this->request->post('friends.getRequests', $access_token, $params); } /** * Returns a list of profiles of users whom the current user may know. * @param string $access_token * @param array $params * - @var array[FriendsGetSuggestionsFilter] filter: Types of potential friends to return: 'mutual' - users with many mutual friends , 'contacts' - users found with the [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' - users who imported the same contacts as the current user with the [vk.com/dev/account.importContacts|account.importContacts] method * - @var integer count: Number of suggestions to return. * - @var integer offset: Offset needed to return a specific subset of suggestions. * - @var array[FriendsGetSuggestionsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. * - @var NameCase name_case: Case for declension of user name and surname: , 'nom' - nominative (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSuggestions(string $access_token, array $params = []) { return $this->request->post('friends.getSuggestions', $access_token, $params); } /** * Returns a list of friends matching the search criteria. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var string q: Search query string (e.g., 'Vasya Babich'). * - @var array[FriendsSearchFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default), 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * - @var integer offset: Offset needed to return a specific subset of friends. * - @var integer count: Number of friends to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('friends.search', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Gifts.php ================================================ request = $request; } /** * Returns a list of user gifts. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var integer count: Number of gifts to return. * - @var integer offset: Offset needed to return a specific subset of results. * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('gifts.get', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Groups.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var string title * - @var string address * - @var string additional_address * - @var integer city_id * - @var integer metro_id * - @var number latitude * - @var number longitude * - @var string phone * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable * - @var string timetable * - @var boolean is_main_address * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings * @throws VKApiNotFoundException Not found * @throws VKApiGroupTooManyAddressesException Too many addresses in club */ public function addAddress(string $access_token, array $params = []) { return $this->request->post('groups.addAddress', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var string url * - @var string title * - @var string secret_key * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiCallbackApiServersLimitException Servers number limit is reached */ public function addCallbackServer(string $access_token, array $params = []) { return $this->request->post('groups.addCallbackServer', $access_token, $params); } /** * Allows to add a link to the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var string link: Link URL. * - @var string text: Description text for the link. * @return mixed * @throws VKClientException * @throws VKApiException */ public function addLink(string $access_token, array $params = []) { return $this->request->post('groups.addLink', $access_token, $params); } /** * Allows to approve join request to the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer user_id: User ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function approveRequest(string $access_token, array $params = []) { return $this->request->post('groups.approveRequest', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer owner_id * - @var integer end_date * - @var integer reason * - @var string comment * - @var boolean comment_visible * @return mixed * @throws VKClientException * @throws VKApiException */ public function ban(string $access_token, array $params = []) { return $this->request->post('groups.ban', $access_token, $params); } /** * Creates a new community. * @param string $access_token * @param array $params * - @var string title: Community title. * - @var string description: Community description (ignored for 'type' = 'public'). * - @var GroupsCreateType type: Community type. Possible values: *'group' - group,, *'event' - event,, *'public' - public page * - @var integer public_category: Category ID (for 'type' = 'public' only). * - @var integer public_subcategory: Public page subcategory ID. * - @var GroupsCreateSubtype subtype: Public page subtype. Possible values: *'1' - place or small business,, *'2' - company, organization or website,, *'3' - famous person or group of people,, *'4' - product or work of art. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function create(string $access_token, array $params = []) { return $this->request->post('groups.create', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer address_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings * @throws VKApiNotFoundException Not found */ public function deleteAddress(string $access_token, array $params = []) { return $this->request->post('groups.deleteAddress', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer server_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function deleteCallbackServer(string $access_token, array $params = []) { return $this->request->post('groups.deleteCallbackServer', $access_token, $params); } /** * Allows to delete a link from the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer link_id: Link ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteLink(string $access_token, array $params = []) { return $this->request->post('groups.deleteLink', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function disableOnline(string $access_token, array $params = []) { return $this->request->post('groups.disableOnline', $access_token, $params); } /** * Edits a community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var string title: Community title. * - @var string description: Community description. * - @var string screen_name: Community screen name. * - @var GroupAccess access: Community type. Possible values: *'0' - open,, *'1' - closed,, *'2' - private. * - @var string website: Website that will be displayed in the community information field. * - @var GroupSubject subject: Community subject. Possible values: , *'1' - auto/moto,, *'2' - activity holidays,, *'3' - business,, *'4' - pets,, *'5' - health,, *'6' - dating and communication, , *'7' - games,, *'8' - IT (computers and software),, *'9' - cinema,, *'10' - beauty and fashion,, *'11' - cooking,, *'12' - art and culture,, *'13' - literature,, *'14' - mobile services and internet,, *'15' - music,, *'16' - science and technology,, *'17' - real estate,, *'18' - news and media,, *'19' - security,, *'20' - education,, *'21' - home and renovations,, *'22' - politics,, *'23' - food,, *'24' - industry,, *'25' - travel,, *'26' - work,, *'27' - entertainment,, *'28' - religion,, *'29' - family,, *'30' - sports,, *'31' - insurance,, *'32' - television,, *'33' - goods and services,, *'34' - hobbies,, *'35' - finance,, *'36' - photo,, *'37' - esoterics,, *'38' - electronics and appliances,, *'39' - erotic,, *'40' - humor,, *'41' - society, humanities,, *'42' - design and graphics. * - @var string email: Organizer email (for events). * - @var string phone: Organizer phone number (for events). * - @var string rss: RSS feed address for import (available only to communities with special permission. Contact vk.com/support to get it. * - @var integer event_start_date: Event start date in Unixtime format. * - @var integer event_finish_date: Event finish date in Unixtime format. * - @var integer event_group_id: Organizer community ID (for events only). * - @var integer public_category: Public page category ID. * - @var integer public_subcategory: Public page subcategory ID. * - @var string public_date: Founding date of a company or organization owning the community in "dd.mm.YYYY" format. * - @var GroupWall wall: Wall settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (groups and events only),, *'3' - closed (groups and events only). * - @var GroupTopics topics: Board topics settings. Possbile values: , *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var GroupPhotos photos: Photos settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var GroupVideo video: Video settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var GroupAudio audio: Audio settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var boolean links: Links settings (for public pages only). Possible values: *'0' - disabled,, *'1' - enabled. * - @var boolean events: Events settings (for public pages only). Possible values: *'0' - disabled,, *'1' - enabled. * - @var boolean places: Places settings (for public pages only). Possible values: *'0' - disabled,, *'1' - enabled. * - @var boolean contacts: Contacts settings (for public pages only). Possible values: *'0' - disabled,, *'1' - enabled. * - @var GroupDocs docs: Documents settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var GroupWiki wiki: Wiki pages settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for groups and events only). * - @var boolean messages: Community messages. Possible values: *'0' - disabled,, *'1' - enabled. * - @var boolean articles * - @var boolean addresses * - @var GroupAgeLimits age_limits: Community age limits. Possible values: *'1' - no limits,, *'2' - 16+,, *'3' - 18+. * - @var boolean market: Market settings. Possible values: *'0' - disabled,, *'1' - enabled. * - @var string market_buttons: Buttons details, see market/objects.json#/definitions/market_custom_button * - @var boolean market_comments: market comments settings. Possible values: *'0' - disabled,, *'1' - enabled. * - @var array[integer] market_country: Market delivery countries. * - @var array[integer] market_city: Market delivery cities (if only one country is specified). * - @var GroupMarketCurrency market_currency: Market currency settings. Possbile values: , *'643' - Russian rubles,, *'980' - Ukrainian hryvnia,, *'398' - Kazakh tenge,, *'978' - Euro,, *'840' - US dollars * - @var integer market_contact: Seller contact for market. Set '0' for community messages. * - @var integer market_wiki: ID of a wiki page with market description. * - @var boolean obscene_filter: Obscene expressions filter in comments. Possible values: , *'0' - disabled,, *'1' - enabled. * - @var boolean obscene_stopwords: Stopwords filter in comments. Possible values: , *'0' - disabled,, *'1' - enabled. * - @var boolean toxic_filter * - @var boolean disable_replies_from_groups * - @var array[string] obscene_words: Keywords for stopwords filter. * - @var integer main_section * - @var integer secondary_section * - @var integer country: Country of the community. * - @var integer city: City of the community. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiInvalidAddressException Invalid screen name */ public function edit(string $access_token, array $params = []) { return $this->request->post('groups.edit', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer address_id * - @var string title * - @var string address * - @var string additional_address * - @var integer city_id * - @var integer metro_id * - @var number latitude * - @var number longitude * - @var string phone * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable * - @var string timetable * - @var boolean is_main_address * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings * @throws VKApiNotFoundException Not found * @throws VKApiGroupTooManyAddressesException Too many addresses in club */ public function editAddress(string $access_token, array $params = []) { return $this->request->post('groups.editAddress', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer server_id * - @var string url * - @var string title * - @var string secret_key * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function editCallbackServer(string $access_token, array $params = []) { return $this->request->post('groups.editCallbackServer', $access_token, $params); } /** * Allows to edit a link in the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer link_id: Link ID. * - @var string text: New description text for the link. * @return mixed * @throws VKClientException * @throws VKApiException */ public function editLink(string $access_token, array $params = []) { return $this->request->post('groups.editLink', $access_token, $params); } /** * Allows to add, remove or edit the community manager. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer user_id: User ID. * - @var GroupRole role: Manager role. Possible values: *'moderator',, *'editor',, *'administrator',, *'advertiser'. * - @var boolean is_call_operator: '1' — allow the manager to accept community calls. * - @var boolean is_contact: '1' - to show the manager in Contacts block of the community. * - @var string contact_position: Position to show in Contacts block. * - @var string contact_phone: Contact phone. * - @var string contact_email: Contact e-mail. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupChangeCreatorException Cannot edit creator role * @throws VKApiGroupNotInClubException User should be in club * @throws VKApiGroupTooManyOfficersException Too many officers in club * @throws VKApiGroupNeed2faException You need to enable 2FA for this action * @throws VKApiGroupHostNeed2faException User needs to enable 2FA for this action */ public function editManager(string $access_token, array $params = []) { return $this->request->post('groups.editManager', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function enableOnline(string $access_token, array $params = []) { return $this->request->post('groups.enableOnline', $access_token, $params); } /** * Returns a list of the communities to which a user belongs. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var boolean extended: '1' - to return complete information about a user's communities, '0' - to return a list of community IDs without any additional fields (default), * - @var array[GroupsGetFilter] filter: Types of communities to return: 'admin' - to return communities administered by the user , 'editor' - to return communities where the user is an administrator or editor, 'moder' - to return communities where the user is an administrator, editor, or moderator, 'groups' - to return only groups, 'publics' - to return only public pages, 'events' - to return only events * - @var array[GroupsGetFields] fields: Profile fields to return. * - @var integer offset: Offset needed to return a specific subset of communities. * - @var integer count: Number of communities to return. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings */ public function get(string $access_token, array $params = []) { return $this->request->post('groups.get', $access_token, $params); } /** * Returns a list of community addresses. * @param string $access_token * @param array $params * - @var integer group_id: ID or screen name of the community. * - @var array[integer] address_ids * - @var number latitude: Latitude of the user geo position. * - @var number longitude: Longitude of the user geo position. * - @var integer offset: Offset needed to return a specific subset of community addresses. * - @var integer count: Number of community addresses to return. * - @var array[GroupsGetAddressesFields] fields: Address fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamGroupIdException Invalid group id * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings */ public function getAddresses(string $access_token, array $params = []) { return $this->request->post('groups.getAddresses', $access_token, $params); } /** * Returns a list of users on a community blacklist. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer offset: Offset needed to return a specific subset of users. * - @var integer count: Number of users to return. * - @var array[GroupsGetBannedFields] fields * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getBanned(string $access_token, array $params = []) { return $this->request->post('groups.getBanned', $access_token, $params); } /** * Returns information about communities by their IDs. * @param string $access_token * @param array $params * - @var array[integer]|array[string] group_ids: IDs or screen names of communities. * - @var integer|string group_id: ID or screen name of the community. * - @var array[GroupsGetByIdFields] fields: Group fields to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('groups.getById', $access_token, $params); } /** * Returns Callback API confirmation code for the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCallbackConfirmationCode(string $access_token, array $params = []) { return $this->request->post('groups.getCallbackConfirmationCode', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var array[integer] server_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCallbackServers(string $access_token, array $params = []) { return $this->request->post('groups.getCallbackServers', $access_token, $params); } /** * Returns [vk.com/dev/callback_api|Callback API] notifications settings. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer server_id: Server ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getCallbackSettings(string $access_token, array $params = []) { return $this->request->post('groups.getCallbackSettings', $access_token, $params); } /** * Returns categories list for communities catalog * @param string $access_token * @param array $params * - @var boolean extended: 1 - to return communities count and three communities for preview. By default: 0. * - @var boolean subcategories: 1 - to return subcategories info. By default: 0. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCatalogInfo(string $access_token, array $params = []) { return $this->request->post('groups.getCatalogInfo', $access_token, $params); } /** * Returns invited users list of a community * @param string $access_token * @param array $params * - @var integer group_id: Group ID to return invited users for. * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of results to return. * - @var array[GroupsGetInvitedUsersFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. * - @var NameCase name_case: Case for declension of user name and surname. Possible values: *'nom' - nominative (default),, *'gen' - genitive,, *'dat' - dative,, *'acc' - accusative, , *'ins' - instrumental,, *'abl' - prepositional. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getInvitedUsers(string $access_token, array $params = []) { return $this->request->post('groups.getInvitedUsers', $access_token, $params); } /** * Returns a list of invitations to join communities and events. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of invitations. * - @var integer count: Number of invitations to return. * - @var boolean extended: '1' - to return additional [vk.com/dev/fields_groups|fields] for communities.. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getInvites(string $access_token, array $params = []) { return $this->request->post('groups.getInvites', $access_token, $params); } /** * Returns the data needed to query a Long Poll server for events * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLongPollServer(string $access_token, array $params = []) { return $this->request->post('groups.getLongPollServer', $access_token, $params); } /** * Returns Long Poll notification settings * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLongPollSettings(string $access_token, array $params = []) { return $this->request->post('groups.getLongPollSettings', $access_token, $params); } /** * Returns a list of community members. * @param string $access_token * @param array $params * - @var integer|string group_id: ID or screen name of the community. * - @var GroupsGetMembersSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'. * - @var integer offset: Offset needed to return a specific subset of community members. * - @var integer count: Number of community members to return. * - @var array[GroupsGetMembersFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. * - @var GroupsGetMembersFilter filter: *'friends' - only friends in this community will be returned,, *'unsure' - only those who pressed 'I may attend' will be returned (if it's an event). * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamGroupIdException Invalid group id */ public function getMembers(string $access_token, array $params = []) { return $this->request->post('groups.getMembers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getOnlineStatus(string $access_token, array $params = []) { return $this->request->post('groups.getOnlineStatus', $access_token, $params); } /** * Returns a list of requests to the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of results to return. * - @var array[GroupsGetRequestsFields] fields: Profile fields to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getRequests(string $access_token, array $params = []) { return $this->request->post('groups.getRequests', $access_token, $params); } /** * Returns community settings. * @param string $access_token * @param array $params * - @var integer|string group_id: Community ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSettings(string $access_token, array $params = []) { return $this->request->post('groups.getSettings', $access_token, $params); } /** * List of group's tags * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTagList(string $access_token, array $params = []) { return $this->request->post('groups.getTagList', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTokenPermissions(string $access_token) { return $this->request->post('groups.getTokenPermissions', $access_token); } /** * Allows to invite friends to the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer user_id: User ID. * - @var array[integer] user_ids_list: User IDs. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function invite(string $access_token, array $params = []) { return $this->request->post('groups.invite', $access_token, $params); } /** * Returns information specifying whether a user is a member of a community. * @param string $access_token * @param array $params * - @var integer|string group_id: ID or screen name of the community. * - @var integer user_id: User ID. * - @var array[integer] user_ids: User IDs. * - @var boolean extended: '1' - to return an extended response with additional fields. By default: '0'. * @return mixed * @throws VKClientException * @throws VKApiException */ public function isMember(string $access_token, array $params = []) { return $this->request->post('groups.isMember', $access_token, $params); } /** * With this method you can join the group or public page, and also confirm your participation in an event. * @param string $access_token * @param array $params * - @var integer group_id: ID or screen name of the community. * - @var string not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' - Perhaps I will attend, '0' - I will be there for sure (default), , * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits * @throws VKApiGroupInviteLinksNotValidException Invite link is invalid - expired, deleted or not exists */ public function join(string $access_token, array $params = []) { return $this->request->post('groups.join', $access_token, $params); } /** * With this method you can leave a group, public page, or event. * @param string $access_token * @param array $params * - @var integer group_id: ID or screen name of the community. * @return mixed * @throws VKClientException * @throws VKApiException */ public function leave(string $access_token, array $params = []) { return $this->request->post('groups.leave', $access_token, $params); } /** * Removes a user from the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer user_id: User ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeUser(string $access_token, array $params = []) { return $this->request->post('groups.removeUser', $access_token, $params); } /** * Allows to reorder links in the community. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer link_id: Link ID. * - @var integer after: ID of the link after which to place the link with 'link_id'. * @return mixed * @throws VKClientException * @throws VKApiException */ public function reorderLink(string $access_token, array $params = []) { return $this->request->post('groups.reorderLink', $access_token, $params); } /** * Returns a list of communities matching the search criteria. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var GroupsSearchType type: Community type. Possible values: 'group, page, event.' * - @var integer country_id: Country ID. * - @var integer city_id: City ID. If this parameter is transmitted, country_id is ignored. * - @var boolean future: '1' - to return only upcoming events. Works with the 'type' = 'event' only. * - @var boolean market: '1' - to return communities with enabled market only. * - @var GroupsSearchSort sort: Sort order. Possible values: *'0' - default sorting (similar the full version of the site),, *'1' - by growth speed,, *'2'- by the "day attendance/members number" ratio,, *'3' - by the "Likes number/members number" ratio,, *'4' - by the "comments number/members number" ratio,, *'5' - by the "boards entries number/members number" ratio. * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of communities to return. "Note that you can not receive more than first thousand of results, regardless of 'count' and 'offset' values." * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('groups.search', $access_token, $params); } /** * Allow to set notifications settings for group. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer server_id: Server ID. * - @var string api_version * - @var boolean message_new: A new incoming message has been received ('0' - disabled, '1' - enabled). * - @var boolean message_reply: A new outcoming message has been received ('0' - disabled, '1' - enabled). * - @var boolean message_allow: Allowed messages notifications ('0' - disabled, '1' - enabled). * - @var boolean message_edit * - @var boolean message_deny: Denied messages notifications ('0' - disabled, '1' - enabled). * - @var boolean message_typing_state * - @var boolean message_read: Messages read notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_new: New photos notifications ('0' - disabled, '1' - enabled). * - @var boolean audio_new: New audios notifications ('0' - disabled, '1' - enabled). * - @var boolean video_new: New videos notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_new: New wall replies notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_restore: A wall comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean wall_post_new: New wall posts notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_repost: New wall posts notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_schedule_post_new: Scheduled post added to time slot ('0' - disabled, '1' - enabled). * - @var boolean wall_schedule_post_delete: Scheduled post removed from time slot ('0' - disabled, '1' - enabled). * - @var boolean board_post_new: New board posts notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_edit: Board posts edited notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_restore: Board posts restored notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_delete: Board posts deleted notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_new: New comment to photo notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_edit: A photo comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_restore: A photo comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean video_comment_new: New comment to video notifications ('0' - disabled, '1' - enabled). * - @var boolean video_comment_edit: A video comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean video_comment_delete: A video comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean video_comment_restore: A video comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean market_comment_new: New comment to market item notifications ('0' - disabled, '1' - enabled). * - @var boolean market_comment_edit: A market comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean market_comment_delete: A market comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean market_comment_restore: A market comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean market_order_new * - @var boolean market_order_edit * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' - disabled, '1' - enabled). * - @var boolean group_join: Joined community notifications ('0' - disabled, '1' - enabled). * - @var boolean group_leave: Left community notifications ('0' - disabled, '1' - enabled). * - @var boolean group_change_settings * - @var boolean group_change_photo * - @var boolean group_officers_edit * - @var boolean user_block: User added to community blacklist * - @var boolean user_unblock: User removed from community blacklist * - @var boolean lead_forms_new: New form in lead forms * - @var boolean like_add * - @var boolean like_remove * - @var boolean message_event * - @var boolean message_reaction_event * - @var boolean donut_subscription_create * - @var boolean donut_subscription_prolonged * - @var boolean donut_subscription_cancelled * - @var boolean donut_subscription_price_changed * - @var boolean donut_subscription_expired * - @var boolean donut_money_withdraw * - @var boolean donut_money_withdraw_error * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function setCallbackSettings(string $access_token, array $params = []) { return $this->request->post('groups.setCallbackSettings', $access_token, $params); } /** * Sets Long Poll notification settings * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var boolean enabled: Sets whether Long Poll is enabled ('0' - disabled, '1' - enabled). * - @var string api_version * - @var boolean message_new: A new incoming message has been received ('0' - disabled, '1' - enabled). * - @var boolean message_reply: A new outcoming message has been received ('0' - disabled, '1' - enabled). * - @var boolean message_allow: Allowed messages notifications ('0' - disabled, '1' - enabled). * - @var boolean message_deny: Denied messages notifications ('0' - disabled, '1' - enabled). * - @var boolean message_edit: A message has been edited ('0' - disabled, '1' - enabled). * - @var boolean message_typing_state * - @var boolean message_read: Messages read notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_new: New photos notifications ('0' - disabled, '1' - enabled). * - @var boolean audio_new: New audios notifications ('0' - disabled, '1' - enabled). * - @var boolean video_new: New videos notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_new: New wall replies notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean wall_reply_restore: A wall comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean wall_post_new: New wall posts notifications ('0' - disabled, '1' - enabled). * - @var boolean wall_repost: New wall posts notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_new: New board posts notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_edit: Board posts edited notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_restore: Board posts restored notifications ('0' - disabled, '1' - enabled). * - @var boolean board_post_delete: Board posts deleted notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_new: New comment to photo notifications ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_edit: A photo comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean photo_comment_restore: A photo comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean video_comment_new: New comment to video notifications ('0' - disabled, '1' - enabled). * - @var boolean video_comment_edit: A video comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean video_comment_delete: A video comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean video_comment_restore: A video comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean market_comment_new: New comment to market item notifications ('0' - disabled, '1' - enabled). * - @var boolean market_comment_edit: A market comment has been edited ('0' - disabled, '1' - enabled). * - @var boolean market_comment_delete: A market comment has been deleted ('0' - disabled, '1' - enabled). * - @var boolean market_comment_restore: A market comment has been restored ('0' - disabled, '1' - enabled). * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' - disabled, '1' - enabled). * - @var boolean group_join: Joined community notifications ('0' - disabled, '1' - enabled). * - @var boolean group_leave: Left community notifications ('0' - disabled, '1' - enabled). * - @var boolean group_change_settings * - @var boolean group_change_photo * - @var boolean group_officers_edit * - @var boolean user_block: User added to community blacklist * - @var boolean user_unblock: User removed from community blacklist * - @var boolean like_add * - @var boolean like_remove * - @var boolean message_event * - @var boolean message_reaction_event * - @var boolean donut_subscription_create * - @var boolean donut_subscription_prolonged * - @var boolean donut_subscription_cancelled * - @var boolean donut_subscription_price_changed * - @var boolean donut_subscription_expired * - @var boolean donut_money_withdraw * - @var boolean donut_money_withdraw_error * @return mixed * @throws VKClientException * @throws VKApiException */ public function setLongPollSettings(string $access_token, array $params = []) { return $this->request->post('groups.setLongPollSettings', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var boolean messages * - @var boolean bots_capabilities: By enabling bot abilities, you can send users messages with a customized keyboard attached as well as use other promotional abilities * - @var boolean bots_start_button: If this setting is enabled, users will see a Start button when they start a chat with your community for the first time * - @var boolean bots_add_to_chat: If this setting is enabled then users can add your community to a chat * - @var boolean bot_online_booking_enabled: If this setting is enabled then online booking chatbot add in your community chats * @return mixed * @throws VKClientException * @throws VKApiException */ public function setSettings(string $access_token, array $params = []) { return $this->request->post('groups.setSettings', $access_token, $params); } /** * In order to save note about group participant * @param string $access_token * @param array $params * - @var integer group_id * - @var integer user_id * - @var string note: Note body * @return mixed * @throws VKClientException * @throws VKApiException */ public function setUserNote(string $access_token, array $params = []) { return $this->request->post('groups.setUserNote', $access_token, $params); } /** * Add new group's tag * @param string $access_token * @param array $params * - @var integer group_id * - @var string tag_name * - @var GroupsTagAddTagColor tag_color * @return mixed * @throws VKClientException * @throws VKApiException */ public function tagAdd(string $access_token, array $params = []) { return $this->request->post('groups.tagAdd', $access_token, $params); } /** * Bind or unbind group's tag to user * @param string $access_token * @param array $params * - @var integer group_id * - @var integer tag_id * - @var integer user_id * - @var GroupsTagBindAct act: Describe the action * @return mixed * @throws VKClientException * @throws VKApiException */ public function tagBind(string $access_token, array $params = []) { return $this->request->post('groups.tagBind', $access_token, $params); } /** * Delete group's tag * @param string $access_token * @param array $params * - @var integer group_id * - @var integer tag_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function tagDelete(string $access_token, array $params = []) { return $this->request->post('groups.tagDelete', $access_token, $params); } /** * Update group's tag * @param string $access_token * @param array $params * - @var integer group_id * - @var integer tag_id * - @var string tag_name * @return mixed * @throws VKClientException * @throws VKApiException */ public function tagUpdate(string $access_token, array $params = []) { return $this->request->post('groups.tagUpdate', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var MarketState state: Declares state if market is enabled in group. * - @var string ref * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketShopAlreadyEnabledException Market was already enabled in this group * @throws VKApiMarketShopAlreadyDisabledException Market was already disabled in this group */ public function toggleMarket(string $access_token, array $params = []) { return $this->request->post('groups.toggleMarket', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function unban(string $access_token, array $params = []) { return $this->request->post('groups.unban', $access_token, $params); } } ================================================ FILE: src/VK/Actions/LeadForms.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var string name * - @var string title * - @var string description * - @var string questions * - @var string policy_link_url * - @var string photo * - @var string confirmation * - @var string site_link_url * - @var boolean active * - @var boolean once_per_user * - @var string pixel_code * - @var array[integer] notify_admins * - @var array[string] notify_emails * @return mixed * @throws VKClientException * @throws VKApiException */ public function create(string $access_token, array $params = []) { return $this->request->post('leadForms.create', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer form_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function delete(string $access_token, array $params = []) { return $this->request->post('leadForms.delete', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer form_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function get(string $access_token, array $params = []) { return $this->request->post('leadForms.get', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer form_id * - @var integer limit * - @var string next_page_token * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getLeads(string $access_token, array $params = []) { return $this->request->post('leadForms.getLeads', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUploadURL(string $access_token) { return $this->request->post('leadForms.getUploadURL', $access_token); } /** * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function list(string $access_token, array $params = []) { return $this->request->post('leadForms.list', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer form_id * - @var string name * - @var string title * - @var string description * - @var string questions * - @var string policy_link_url * - @var string photo * - @var string confirmation * - @var string site_link_url * - @var boolean active * - @var boolean once_per_user * - @var string pixel_code * - @var array[integer] notify_admins * - @var array[string] notify_emails * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function update(string $access_token, array $params = []) { return $this->request->post('leadForms.update', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Likes.php ================================================ request = $request; } /** * Adds the specified object to the 'Likes' list of the current user. * @param string $access_token * @param array $params * - @var LikesType type: Object type: 'post' - post on user or community wall, 'comment' - comment on a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'story' - story, 'note' - note, 'photo_comment' - comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed * - @var integer owner_id: ID of the user or community that owns the object. * - @var integer item_id: Object ID. * - @var string access_key: Access key required for an object owned by a private entity. * - @var boolean from_group: Impersonate group * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLikesReactionCanNotBeAppliedException Reaction can not be applied to the object */ public function add(string $access_token, array $params = []) { return $this->request->post('likes.add', $access_token, $params); } /** * Deletes the specified object from the 'Likes' list of the current user. * @param string $access_token * @param array $params * - @var LikesType type: Object type: 'post' - post on user or community wall, 'comment' - comment on a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'story' - story, 'note' - note, 'photo_comment' - comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed * - @var integer owner_id: ID of the user or community that owns the object. * - @var integer item_id: Object ID. * - @var string access_key: Access key required for an object owned by a private entity. * - @var boolean from_group: Impersonate group * @return mixed * @throws VKClientException * @throws VKApiException */ public function delete(string $access_token, array $params = []) { return $this->request->post('likes.delete', $access_token, $params); } /** * Returns a list of IDs of users who added the specified object to their 'Likes' list. * @param string $access_token * @param array $params * - @var LikesType type: , Object type: 'post' - post on user or community wall, 'comment' - comment on a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'story' - story, 'note' - note, 'photo_comment' - comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed * - @var integer owner_id: ID of the user, community, or application that owns the object. If the 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or the same application ID as if the 'type' parameter was set to 'sitepage'. * - @var integer item_id: Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. * - @var string page_url: URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used instead of the 'item_id' parameter. * - @var LikesGetListFilter filter: Filters to apply: 'likes' - returns information about all users who liked the object (default), 'copies' - returns information only about users who told their friends about the object * - @var LikesGetListFriendsOnly friends_only: Specifies which users are returned: '1' - to return only the current user's friends, '0' - to return all users (default) * - @var boolean extended: Specifies whether extended information will be returned. '1' - to return extended information about users and communities from the 'Likes' list, '0' - to return no additional information (default) * - @var integer offset: Offset needed to select a specific subset of users. * - @var integer count: Number of user IDs to return (maximum '1000'). Default is '100' if 'friends_only' is set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. * - @var boolean skip_own * - @var array[string] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLikesReactionCanNotBeAppliedException Reaction can not be applied to the object */ public function getList(string $access_token, array $params = []) { return $this->request->post('likes.getList', $access_token, $params); } /** * Checks for the object in the 'Likes' list of the specified user. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var LikesType type: Object type: 'post' - post on user or community wall, 'comment' - comment on a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'story' - story, 'note' - note, 'photo_comment' - comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the discussion * - @var integer owner_id: ID of the user or community that owns the object. * - @var integer item_id: Object ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function isLiked(string $access_token, array $params = []) { return $this->request->post('likes.isLiked', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Market.php ================================================ request = $request; } /** * Ads a new item to the market. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var string name: Item name. * - @var string description: Item description. * - @var integer category_id: Item category ID. * - @var number price: Item price. * - @var number old_price * - @var boolean deleted: Item status ('1' - deleted, '0' - not deleted). * - @var integer main_photo_id: Cover photo ID. * - @var array[integer] photo_ids: IDs of additional photos. * - @var array[integer] video_ids: IDs of additional videos. * - @var string url: Url for button in market item. * - @var array[integer] variant_ids: IDs of properties variants. * - @var boolean is_main_variant: Is main in their group. * - @var integer dimension_width * - @var integer dimension_height * - @var integer dimension_length * - @var integer weight * - @var string sku * - @var integer stock_amount * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketTooManyItemsException Too many items * @throws VKApiMarketItemHasBadLinksException Item has bad links in description * @throws VKApiMarketVariantNotFoundException Variant not found * @throws VKApiMarketPropertyNotFoundException Property not found * @throws VKApiMarketGroupingItemsMustHaveDistinctPropertiesException Item must have distinct properties * @throws VKApiMarketGroupingMustContainMoreThanOneItemException Grouping must have two or more items * @throws VKApiMarketPhotosCropInvalidFormatException Invalid image crop format * @throws VKApiMarketPhotosCropOverflowException Crop bottom right corner is outside of the image * @throws VKApiMarketPhotosCropSizeTooLowException Crop size is less than the minimum * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketTooManyItemsInAlbumException Too many items in album */ public function add(string $access_token, array $params = []) { return $this->request->post('market.add', $access_token, $params); } /** * Creates new collection of items * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var string title: Collection title. * - @var integer photo_id: Cover photo ID. * - @var boolean main_album: Set as main ('1' - set, '0' - no). * - @var boolean is_hidden: Set as hidden * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketTooManyAlbumsException Too many albums * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketAlbumMainHiddenException Main album can not be hidden */ public function addAlbum(string $access_token, array $params = []) { return $this->request->post('market.addAlbum', $access_token, $params); } /** * Adds property * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var string title: Property name. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketNameTooLongException Name too long * @throws VKApiMarketUnknownPropertyTypeException Unknown property type * @throws VKApiMarketMaxPropertiesLimitExceedException Max properties limit exceeded * @throws VKApiMarketVariantsNotEnabledException Variants not enabled * @throws VKApiMarketNotEnabledException Market not enabled */ public function addProperty(string $access_token, array $params = []) { return $this->request->post('market.addProperty', $access_token, $params); } /** * Adds property variant * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer property_id: Property id. * - @var string title: Variant name. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketVariantValueTooLongException Variant value is too long * @throws VKApiMarketMaxVariantsLimitExceedException Max variant limit exceeded * @throws VKApiMarketPropertyNotFoundException Property not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function addPropertyVariant(string $access_token, array $params = []) { return $this->request->post('market.addPropertyVariant', $access_token, $params); } /** * Adds an item to one or multiple collections. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var array[integer] item_ids * - @var array[integer] album_ids: Collections IDs to add item to. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketTooManyItemsInAlbumException Too many items in album * @throws VKApiMarketItemAlreadyAddedException Item already added to album * @throws VKApiMarketAddToServiceAlbumException Add item to service album * @throws VKApiMarketAddToMarketAlbumException Add service to market album */ public function addToAlbum(string $access_token, array $params = []) { return $this->request->post('market.addToAlbum', $access_token, $params); } /** * Creates a new comment for an item. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Item ID. * - @var string message: Comment text (required if 'attachments' parameter is not specified) * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", * - @var boolean from_group: '1' - comment will be published on behalf of a community, '0' - on behalf of a user (by default). * - @var integer reply_to_comment: ID of a comment to reply with current comment to. * - @var integer sticker_id: Sticker ID. * - @var string guid: Random value to avoid resending one comment. * @return mixed * @throws VKClientException * @throws VKApiException */ public function createComment(string $access_token, array $params = []) { return $this->request->post('market.createComment', $access_token, $params); } /** * Deletes an item. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Item ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketItemNotFoundException Item not found */ public function delete(string $access_token, array $params = []) { return $this->request->post('market.delete', $access_token, $params); } /** * Deletes a collection of items. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an collection owner community. * - @var integer album_id: Collection ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function deleteAlbum(string $access_token, array $params = []) { return $this->request->post('market.deleteAlbum', $access_token, $params); } /** * Deletes an item's comment * @param string $access_token * @param array $params * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " * - @var integer comment_id: comment id * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('market.deleteComment', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer property_id: Property id. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketPropertyNotFoundException Property not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function deleteProperty(string $access_token, array $params = []) { return $this->request->post('market.deleteProperty', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer variant_id: Variant id. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketPropertyNotFoundException Property not found * @throws VKApiMarketVariantNotFoundException Variant not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function deletePropertyVariant(string $access_token, array $params = []) { return $this->request->post('market.deletePropertyVariant', $access_token, $params); } /** * Edits an item. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Item ID. * - @var string name: Item name. * - @var string description: Item description. * - @var integer category_id: Item category ID. * - @var number price: Item price. * - @var number old_price * - @var boolean deleted: Item status ('1' - deleted, '0' - not deleted). * - @var integer main_photo_id: Cover photo ID. * - @var array[integer] photo_ids: IDs of additional photos. * - @var array[integer] video_ids: IDs of additional videos. * - @var string url: Url for button in market item. * - @var array[integer] variant_ids: IDs of properties variants. * - @var boolean is_main_variant: Is main in their group. * - @var integer dimension_width * - @var integer dimension_height * - @var integer dimension_length * - @var integer weight * - @var string sku * - @var integer stock_amount * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketItemHasBadLinksException Item has bad links in description * @throws VKApiMarketGroupingItemsWithDifferentPropertiesException Grouping items with different properties * @throws VKApiMarketGroupingAlreadyHasSuchVariantException Grouping already has such variant * @throws VKApiMarketPhotosCropInvalidFormatException Invalid image crop format * @throws VKApiMarketPhotosCropOverflowException Crop bottom right corner is outside of the image * @throws VKApiMarketPhotosCropSizeTooLowException Crop size is less than the minimum * @throws VKApiMarketNotEnabledException Market not enabled */ public function edit(string $access_token, array $params = []) { return $this->request->post('market.edit', $access_token, $params); } /** * Edits a collection of items * @param string $access_token * @param array $params * - @var integer owner_id: ID of an collection owner community. * - @var integer album_id: Collection ID. * - @var string title: Collection title. * - @var integer photo_id: Cover photo id * - @var boolean main_album: Set as main ('1' - set, '0' - no). * - @var boolean is_hidden: Set as hidden * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketAlbumMainHiddenException Main album can not be hidden * @throws VKApiMarketFailedToSetAlbumAsMainException Failed to set album as main * @throws VKApiMarketFailedToUnsetAlbumAsMainException Failed to unset album as main */ public function editAlbum(string $access_token, array $params = []) { return $this->request->post('market.editAlbum', $access_token, $params); } /** * Chages item comment's text * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer comment_id: Comment ID. * - @var string message: New comment text (required if 'attachments' are not specified), , 2048 symbols maximum. * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", * @return mixed * @throws VKClientException * @throws VKApiException */ public function editComment(string $access_token, array $params = []) { return $this->request->post('market.editComment', $access_token, $params); } /** * Edit order * @param string $access_token * @param array $params * - @var integer user_id * - @var integer order_id * - @var string merchant_comment * - @var integer status * - @var string track_number * - @var MarketEditOrderPaymentStatus payment_status * - @var integer delivery_price * - @var integer width * - @var integer length * - @var integer height * - @var integer weight * - @var string comment_for_user * - @var string receipt_link * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketOrdersNoCartItemsException Cart is empty * @throws VKApiMarketInvalidDimensionsException Specify width, length, height and weight all together * @throws VKApiMarketCantChangeVkpayStatusException VK Pay status can not be changed * @throws VKApiMarketOrdersInvalidStatusException Order status is invalid */ public function editOrder(string $access_token, array $params = []) { return $this->request->post('market.editOrder', $access_token, $params); } /** * Adds property * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer property_id: Property id. * - @var string title: Property name * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketNameTooLongException Name too long * @throws VKApiMarketUnknownPropertyTypeException Unknown property type * @throws VKApiMarketNotEnabledException Market not enabled */ public function editProperty(string $access_token, array $params = []) { return $this->request->post('market.editProperty', $access_token, $params); } /** * Edit property variant name * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer variant_id: Variant id. * - @var string title: Variant name. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketNameTooLongException Name too long * @throws VKApiMarketVariantValueTooLongException Variant value is too long * @throws VKApiMarketVariantNotFoundException Variant not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function editPropertyVariant(string $access_token, array $params = []) { return $this->request->post('market.editPropertyVariant', $access_token, $params); } /** * Returns a filter list of market categories. * @param string $access_token * @param array $params * - @var integer category_id: Category_id filter categories * - @var string query: Query filter categories * - @var integer count: Number of results to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function filterCategories(string $access_token, array $params = []) { return $this->request->post('market.filterCategories', $access_token, $params); } /** * Returns items list for a community. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " * - @var integer album_id * - @var integer count: Number of items to return. * - @var integer offset: Offset needed to return a specific subset of results. * - @var boolean extended: '1' - method will return additional fields: 'likes, can_comment, car_repost, photos'. These parameters are not returned by default. * - @var string date_from: Items update date from (format: yyyy-mm-dd) * - @var string date_to: Items update date to (format: yyyy-mm-dd) * - @var boolean need_variants: Add variants to response if exist * - @var boolean with_disabled: Add disabled items to response * - @var array[string] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('market.get', $access_token, $params); } /** * Returns items album's data * @param string $access_token * @param array $params * - @var integer owner_id: identifier of an album owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " * - @var array[integer] album_ids: collections identifiers to obtain data from * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAlbumById(string $access_token, array $params = []) { return $this->request->post('market.getAlbumById', $access_token, $params); } /** * Returns community's market collections list. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an items owner community. * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of items to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAlbums(string $access_token, array $params = []) { return $this->request->post('market.getAlbums', $access_token, $params); } /** * Returns information about market items by their ids. * @param string $access_token * @param array $params * - @var array[string] item_ids: Comma-separated ids list: {user id}_{item id}. If an item belongs to a community -{community id} is used. " 'Videos' value example: , '-4363_136089719,13245770_137352259'" * - @var boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketDisabledException Market is disabled * @throws VKApiMarketServicesDisabledException Market services are disabled */ public function getById(string $access_token, array $params = []) { return $this->request->post('market.getById', $access_token, $params); } /** * Returns a list of market categories. * @param string $access_token * @param array $params * - @var integer group_id: Group Id. * - @var integer album_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getCategories(string $access_token, array $params = []) { return $this->request->post('market.getCategories', $access_token, $params); } /** * Returns comments list for an item. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community * - @var integer item_id: Item ID. * - @var boolean need_likes: '1' - to return likes info. * - @var integer start_comment_id: ID of a comment to start a list from (details below). * - @var integer offset * - @var integer count: Number of results to return. * - @var MarketGetCommentsSort sort: Sort order ('asc' - from old to new, 'desc' - from new to old) * - @var boolean extended: '1' - comments will be returned as numbered objects, in addition lists of 'profiles' and 'groups' objects will be returned. * - @var array[MarketGetCommentsFields] fields: List of additional profile fields to return. See the [vk.com/dev/fields|details] * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketCommentsClosedException Comments for this market are closed */ public function getComments(string $access_token, array $params = []) { return $this->request->post('market.getComments', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer current_group_id: Group which represents content * - @var boolean public_only * - @var integer offset: Offset needed to return a specific subset of users. * - @var integer count: Number of users to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFavesForAttach(string $access_token, array $params = []) { return $this->request->post('market.getFavesForAttach', $access_token, $params); } /** * Get market orders * @param string $access_token * @param array $params * - @var integer|string group_id: ID or groups domain * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketOrdersInvalidStatusException Order status is invalid */ public function getGroupOrders(string $access_token, array $params = []) { return $this->request->post('market.getGroupOrders', $access_token, $params); } /** * Get order * @param string $access_token * @param array $params * - @var integer user_id * - @var integer order_id * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketOrdersOrderNotFoundException Order not found */ public function getOrderById(string $access_token, array $params = []) { return $this->request->post('market.getOrderById', $access_token, $params); } /** * Get market items in the order * @param string $access_token * @param array $params * - @var integer user_id * - @var integer order_id * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function getOrderItems(string $access_token, array $params = []) { return $this->request->post('market.getOrderItems', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer offset * - @var integer count * - @var boolean extended * - @var string date_from: Orders status updated date from (format: yyyy-mm-dd) * - @var string date_to: Orders status updated date to (format: yyyy-mm-dd) * @return mixed * @throws VKClientException * @throws VKApiException */ public function getOrders(string $access_token, array $params = []) { return $this->request->post('market.getOrders', $access_token, $params); } /** * Returns the server address for market photo upload. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var boolean bulk * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketNotEnabledException Market not enabled */ public function getProductPhotoUploadServer(string $access_token, array $params = []) { return $this->request->post('market.getProductPhotoUploadServer', $access_token, $params); } /** * Get properties * @param string $access_token * @param array $params * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketVariantsNotEnabledException Variants not enabled * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled */ public function getProperties(string $access_token, array $params = []) { return $this->request->post('market.getProperties', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var array[integer] item_ids: Item ids. * - @var integer item_group_id: Items group id. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketGroupingItemsWithDifferentPropertiesException Grouping items with different properties * @throws VKApiMarketGroupingAlreadyHasSuchVariantException Grouping already has such variant * @throws VKApiMarketGroupingHasOtherPropertiesException Grouping has other properties * @throws VKApiMarketGroupingMustHaveVariantsException Grouping must have variants * @throws VKApiMarketVariantNotFoundException Variant not found * @throws VKApiMarketVariantsNotEnabledException Variants not enabled * @throws VKApiMarketPropertyNotFoundException Property not found * @throws VKApiMarketGroupingMustContainMoreThanOneItemException Grouping must have two or more items * @throws VKApiMarketGroupingItemsMustHaveDistinctPropertiesException Item must have distinct properties * @throws VKApiMarketNotEnabledException Market not enabled */ public function groupItems(string $access_token, array $params = []) { return $this->request->post('market.groupItems', $access_token, $params); } /** * Removes an item from one or multiple collections. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Item ID. * - @var array[integer] album_ids: Collections IDs to remove item from. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function removeFromAlbum(string $access_token, array $params = []) { return $this->request->post('market.removeFromAlbum', $access_token, $params); } /** * Reorders the collections list. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer album_id: Collection ID. * - @var integer before: ID of a collection to place current collection before it. * - @var integer after: ID of a collection to place current collection after it. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function reorderAlbums(string $access_token, array $params = []) { return $this->request->post('market.reorderAlbums', $access_token, $params); } /** * Changes item place in a collection. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer album_id: ID of a collection to reorder items in. Set 0 to reorder full items list. * - @var integer item_id: Item ID. * - @var integer before: ID of an item to place current item before it. * - @var integer after: ID of an item to place current item after it. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketAlbumNotFoundException Album not found * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketNotEnabledException Market not enabled */ public function reorderItems(string $access_token, array $params = []) { return $this->request->post('market.reorderItems', $access_token, $params); } /** * Sends a complaint to the item. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Item ID. * - @var MarketReportReason reason: Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. * @return mixed * @throws VKClientException * @throws VKApiException */ public function report(string $access_token, array $params = []) { return $this->request->post('market.report', $access_token, $params); } /** * Sends a complaint to the item's comment. * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer comment_id: Comment ID. * - @var MarketReportCommentReason reason: Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. * @return mixed * @throws VKClientException * @throws VKApiException */ public function reportComment(string $access_token, array $params = []) { return $this->request->post('market.reportComment', $access_token, $params); } /** * Restores recently deleted item * @param string $access_token * @param array $params * - @var integer owner_id: ID of an item owner community. * - @var integer item_id: Deleted item ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessMarketException Access denied * @throws VKApiMarketRestoreTooLateException Too late for restore * @throws VKApiMarketNotEnabledException Market not enabled * @throws VKApiMarketItemNotFoundException Item not found * @throws VKApiMarketItemIsNotDeletedException Item is not deleted */ public function restore(string $access_token, array $params = []) { return $this->request->post('market.restore', $access_token, $params); } /** * Restores a recently deleted comment * @param string $access_token * @param array $params * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " * - @var integer comment_id: deleted comment id * @return mixed * @throws VKClientException * @throws VKApiException */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('market.restoreComment', $access_token, $params); } /** * Save market photo after upload. * @param string $access_token * @param array $params * - @var string upload_response: Upload response * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketNotEnabledException Market not enabled */ public function saveProductPhoto(string $access_token, array $params = []) { return $this->request->post('market.saveProductPhoto', $access_token, $params); } /** * Bulk save market photo after upload. * @param string $access_token * @param array $params * - @var string upload_response: Upload response * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketNotEnabledException Market not enabled */ public function saveProductPhotoBulk(string $access_token, array $params = []) { return $this->request->post('market.saveProductPhotoBulk', $access_token, $params); } /** * Searches market items in a community's catalog * @param string $access_token * @param array $params * - @var integer owner_id: ID of an items owner community. * - @var integer album_id * - @var string q: Search query, for example "pink slippers". * - @var integer price_from: Minimum item price value. * - @var integer price_to: Maximum item price value. * - @var MarketSearchSort sort * - @var MarketSearchRev rev: '0' - do not use reverse order, '1' - use reverse order * - @var integer offset: Offset needed to return a specific subset of results. * - @var integer count: Number of items to return. * - @var boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. * - @var array[integer] status * - @var boolean need_variants: Add variants to response if exist * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('market.search', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string q * - @var integer offset * - @var integer count * - @var integer category_id * - @var integer price_from * - @var integer price_to * - @var MarketSearchItemsSortBy sort_by * - @var MarketSearchItemsSortDirection sort_direction * - @var integer country * - @var integer city * @return mixed * @throws VKClientException * @throws VKApiException */ public function searchItems(string $access_token, array $params = []) { return $this->request->post('market.searchItems', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string q * - @var integer offset * - @var integer count * - @var integer category_id * - @var integer price_from * - @var integer price_to * - @var MarketSearchItemsBasicSortBy sort_by * - @var MarketSearchItemsBasicSortDirection sort_direction * - @var integer country * - @var integer city * - @var boolean only_my_groups * @return mixed * @throws VKClientException * @throws VKApiException */ public function searchItemsBasic(string $access_token, array $params = []) { return $this->request->post('market.searchItemsBasic', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id: Group id. * - @var integer item_group_id: Items group id. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketExtendedNotEnabledException Extended market not enabled * @throws VKApiMarketVariantsException Variants error * @throws VKApiMarketNotEnabledException Market not enabled */ public function ungroupItems(string $access_token, array $params = []) { return $this->request->post('market.ungroupItems', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Messages.php ================================================ request = $request; } /** * Adds a new user to a chat. * @param string $access_token * @param array $params * - @var integer chat_id: Chat ID. * - @var integer user_id: ID of the user to be added to the chat. * - @var integer visible_messages_count * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesMessageRequestAlreadySentException Message request already sent * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesChatDisabledException Chat was disabled * @throws VKApiMessagesMemberAccessToGroupDeniedException Can't add user to chat, because user has no access to group * @throws VKApiMessagesChatUnsupportedException Chat not supported * @throws VKApiMessagesGroupPeerAccessException Your community can't interact with this peer * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat */ public function addChatUser(string $access_token, array $params = []) { return $this->request->post('messages.addChatUser', $access_token, $params); } /** * Adds new users to a chat. * @param string $access_token * @param array $params * - @var integer chat_id * - @var integer visible_messages_count * @return mixed * @throws VKClientException * @throws VKApiException */ public function addChatUsers(string $access_token, array $params = []) { return $this->request->post('messages.addChatUsers', $access_token, $params); } /** * Allows sending messages from community to the current user. * @param string $access_token * @param array $params * - @var integer group_id: Group ID. * - @var string key * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesIntentCantUseException Cannot use this intent */ public function allowMessagesFromGroup(string $access_token, array $params = []) { return $this->request->post('messages.allowMessagesFromGroup', $access_token, $params); } /** * Creates a chat with several participants. * @param string $access_token * @param array $params * - @var array[integer] user_ids: IDs of the users to be added to the chat. * - @var string title: Chat title. * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesContactNotFoundException Contact not found */ public function createChat(string $access_token, array $params = []) { return $this->request->post('messages.createChat', $access_token, $params); } /** * Deletes one or more messages. * @param string $access_token * @param array $params * - @var array[integer] message_ids: Message IDs. * - @var boolean spam: '1' - to mark message as spam. * - @var integer reason: Reason for spam * - @var integer group_id: Group ID (for group messages with user access token) * - @var boolean delete_for_all: '1' - delete message for for all. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var array[integer] cmids: Conversation message IDs. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesCantDeleteForAllException Can't delete this message for everybody * @throws VKApiMessagesChatNotExistException Chat does not exist */ public function delete(string $access_token, array $params = []) { return $this->request->post('messages.delete', $access_token, $params); } /** * Deletes a chat's cover picture. * @param string $access_token * @param array $params * - @var integer chat_id: Chat ID. * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesChatDisabledException Chat was disabled */ public function deleteChatPhoto(string $access_token, array $params = []) { return $this->request->post('messages.deleteChatPhoto', $access_token, $params); } /** * Deletes all private messages in a conversation. * @param string $access_token * @param array $params * - @var integer user_id: User ID. To clear a chat history use 'chat_id' * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var integer group_id: Group ID (for group messages with user access token) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesContactNotFoundException Contact not found */ public function deleteConversation(string $access_token, array $params = []) { return $this->request->post('messages.deleteConversation', $access_token, $params); } /** * Delete message reaction * @param string $access_token * @param array $params * - @var integer peer_id * - @var integer cmid * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteReaction(string $access_token, array $params = []) { return $this->request->post('messages.deleteReaction', $access_token, $params); } /** * Denies sending message from community to the current user. * @param string $access_token * @param array $params * - @var integer group_id: Group ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function denyMessagesFromGroup(string $access_token, array $params = []) { return $this->request->post('messages.denyMessagesFromGroup', $access_token, $params); } /** * Edits the message. * @param string $access_token * @param array $params * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var string message: (Required if 'attachments' is not set.) Text of the message. * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - wall post, '' - ID of the media attachment owner. '' - media attachment ID. Example: "photo100172_166443618" * - @var boolean keep_forward_messages: '1' - to keep forwarded, messages. * - @var boolean keep_snippets: '1' - to keep attached snippets. * - @var integer group_id: Group ID (for group messages with user access token) * - @var boolean dont_parse_links * - @var boolean disable_mentions * - @var integer message_id * - @var integer cmid * - @var string template * - @var string keyboard * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesDenySendException Can't send messages for users without permission * @throws VKApiMessagesEditExpiredException Can't edit this message, because it's too old * @throws VKApiMessagesTooBigException Can't sent this message, because it's too big * @throws VKApiMessagesEditKindDisallowedException Can't edit this kind of message * @throws VKApiMessagesTooLongMessageException Message is too long * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid * @throws VKApiMessagesTooManyPostsException Too many posts in messages * @throws VKApiMessagesChatUnsupportedException Chat not supported * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings * @throws VKApiMessagesCantEditPinnedYetException Can't edit pinned message yet */ public function edit(string $access_token, array $params = []) { return $this->request->post('messages.edit', $access_token, $params); } /** * Edits the title of a chat. * @param string $access_token * @param array $params * - @var integer chat_id: Chat ID. * - @var string title: New title of the chat. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesChatDisabledException Chat was disabled * @throws VKApiMessagesChatUnsupportedException Chat not supported * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat */ public function editChat(string $access_token, array $params = []) { return $this->request->post('messages.editChat', $access_token, $params); } /** * Returns messages by their IDs within the conversation. * @param string $access_token * @param array $params * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var array[integer] conversation_message_ids: Conversation message IDs. * - @var boolean extended: Information whether the response should be extended * - @var array[MessagesGetByConversationMessageIdFields] fields: Profile fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function getByConversationMessageId(string $access_token, array $params = []) { return $this->request->post('messages.getByConversationMessageId', $access_token, $params); } /** * Returns messages by their IDs. * @param string $access_token * @param array $params * - @var array[integer] message_ids: Message IDs. * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." * - @var boolean extended: Information whether the response should be extended * - @var array[MessagesGetByIdFields] fields: Profile fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * - @var array[integer] cmids * - @var integer peer_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('messages.getById', $access_token, $params); } /** * Returns information about a chat. * @param string $access_token * @param array $params * - @var integer chat_id: Chat ID. * - @var array[integer] chat_ids: Chat IDs. * - @var array[MessagesGetChatFields] fields: Profile fields to return. * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default), 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatDisabledException Chat was disabled * @throws VKApiMessagesChatUnsupportedException Chat not supported * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat * @throws VKApiMessagesChatNotAdminException You are not admin of this chat */ public function getChat(string $access_token, array $params = []) { return $this->request->post('messages.getChat', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer peer_id * - @var string link: Invitation link. * - @var array[MessagesGetChatPreviewFields] fields: Profile fields to return. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesDenySendException Can't send messages for users without permission */ public function getChatPreview(string $access_token, array $params = []) { return $this->request->post('messages.getChatPreview', $access_token, $params); } /** * Returns a list of IDs of users participating in a chat. * @param string $access_token * @param array $params * - @var integer peer_id: Peer ID. * - @var integer offset * - @var integer count * - @var boolean extended: Extended flag * - @var array[MessagesGetConversationMembersFields] fields: Profile fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * - @var array[integer] member_ids * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesChatNotExistException Chat does not exist */ public function getConversationMembers(string $access_token, array $params = []) { return $this->request->post('messages.getConversationMembers', $access_token, $params); } /** * Returns a list of the current user's conversations. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of conversations. * - @var integer count: Number of conversations to return. * - @var MessagesGetConversationsFilter filter: Filter to apply: 'all' - all conversations, 'unread' - conversations with unread messages, 'important' - conversations, marked as important (only for community messages), 'unanswered' - conversations, marked as unanswered (only for community messages) * - @var boolean extended: '1' - return extra information about users and communities * - @var integer start_message_id: ID of the message from what to return dialogs. * - @var array[MessagesGetConversationsFields] fields: Profile and communities fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotExistException Chat does not exist * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat */ public function getConversations(string $access_token, array $params = []) { return $this->request->post('messages.getConversations', $access_token, $params); } /** * Returns conversations by their IDs * @param string $access_token * @param array $params * - @var array[integer] peer_ids: Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var boolean extended: Return extended properties * - @var array[MessagesGetConversationsByIdFields] fields: Profile and communities fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotExistException Chat does not exist * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesContactNotFoundException Contact not found */ public function getConversationsById(string $access_token, array $params = []) { return $this->request->post('messages.getConversationsById', $access_token, $params); } /** * Returns message history for the specified user or group chat. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of messages. * - @var integer count: Number of messages to return. * - @var integer user_id: ID of the user whose message history you want to return. * - @var integer peer_id * - @var integer start_message_id: Starting message ID from which to return history. * - @var MessagesGetHistoryRev rev: Sort order: '1' - return messages in chronological order. '0' - return messages in reverse chronological order. * - @var boolean extended: Information whether the response should be extended * - @var array[MessagesGetHistoryFields] fields: Profile fields to return. * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesChatNotExistException Chat does not exist */ public function getHistory(string $access_token, array $params = []) { return $this->request->post('messages.getHistory', $access_token, $params); } /** * Returns media files from the dialog or group chat. * @param string $access_token * @param array $params * - @var array[MessagesGetHistoryAttachmentsAttachmentTypes] attachment_types * - @var integer group_id: Group ID (for group messages with group access token) * - @var integer peer_id: Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: '-community ID'" * - @var integer cmid * - @var integer attachment_position * - @var integer offset * - @var integer count: Number of objects to return. * - @var boolean extended * - @var array[MessagesGetHistoryAttachmentsFields] fields: Additional profile [vk.com/dev/fields|fields] to return. * - @var integer max_forwards_level * - @var boolean message_video * - @var MessagesGetHistoryAttachmentsMediaType media_type: Type of media files to return: *'photo',, *'video',, *'audio',, *'doc',, *'link'.,*'market'.,*'wall'.,*'share' * - @var string start_from: Message ID to start return results from. * - @var boolean preserve_order * - @var boolean photo_sizes: '1' - to return photo sizes in a * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotExistException Chat does not exist */ public function getHistoryAttachments(string $access_token, array $params = []) { return $this->request->post('messages.getHistoryAttachments', $access_token, $params); } /** * Returns a list of user's important messages. * @param string $access_token * @param array $params * - @var integer count: Amount of needed important messages. * - @var integer offset * - @var integer start_message_id * - @var integer preview_length: Maximum length of messages body. * - @var array[MessagesGetImportantMessagesFields] fields: Actors fields to return. * - @var boolean extended: Return extended properties * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function getImportantMessages(string $access_token, array $params = []) { return $this->request->post('messages.getImportantMessages', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var MessagesGetIntentUsersIntent intent * - @var integer subscribe_id * - @var integer offset * - @var integer count * - @var boolean extended * - @var NameCase name_case * - @var array[string] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesIntentCantUseException Cannot use this intent */ public function getIntentUsers(string $access_token, array $params = []) { return $this->request->post('messages.getIntentUsers', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer peer_id: Destination ID. * - @var boolean reset: 1 - to generate new link (revoke previous), 0 - to return previous link. * - @var integer group_id: Group ID * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesCantSeeInviteLinkException You can't see invite link for this chat * @throws VKApiMessagesCantChangeInviteLinkException You can't change invite link for this chat */ public function getInviteLink(string $access_token, array $params = []) { return $this->request->post('messages.getInviteLink', $access_token, $params); } /** * Returns a user's current status and date of last activity. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLastActivity(string $access_token, array $params = []) { return $this->request->post('messages.getLastActivity', $access_token, $params); } /** * Returns updates in user's private messages. * @param string $access_token * @param array $params * - @var integer ts: Last value of the 'ts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. * - @var integer pts: Last value of 'pts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." * - @var boolean onlines: '1' - to return history with online users only. * - @var array[MessagesGetLongPollHistoryFields] fields: Additional profile [vk.com/dev/fields|fields] to return. * - @var integer events_limit: Maximum number of events to return. * - @var integer msgs_limit: Maximum number of messages to return. * - @var integer max_msg_id: Maximum ID of the message among existing ones in the local copy. Both messages received with API methods (for example, , ), and data received from a Long Poll server (events with code 4) are taken into account. * - @var integer group_id: Group ID (for group messages with user access token) * - @var integer lp_version * - @var integer last_n * - @var boolean credentials * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesTooOldPtsException Value of ts or pts is too old * @throws VKApiMessagesTooNewPtsException Value of ts or pts is too new * @throws VKApiTimeoutException Method execution was interrupted due to timeout * @throws VKApiMessagesChatNotExistException Chat does not exist * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesDropDeviceCacheException Drop device cache */ public function getLongPollHistory(string $access_token, array $params = []) { return $this->request->post('messages.getLongPollHistory', $access_token, $params); } /** * Returns data required for connection to a Long Poll server. * @param string $access_token * @param array $params * - @var boolean need_pts: '1' - to return the 'pts' field, needed for the [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. * - @var integer group_id: Group ID (for group messages with user access token) * - @var integer lp_version: Long poll version * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLongPollServer(string $access_token, array $params = []) { return $this->request->post('messages.getLongPollServer', $access_token, $params); } /** * Get reaction counters for message * @param string $access_token * @param array $params * - @var integer peer_id * - @var array[integer] cmids * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMessagesReactions(string $access_token, array $params = []) { return $this->request->post('messages.getMessagesReactions', $access_token, $params); } /** * Get reacted users and counters for message * @param string $access_token * @param array $params * - @var integer peer_id * - @var integer cmid * - @var integer reaction_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesInvalidReactionIdException Unknown reaction passed */ public function getReactedPeers(string $access_token, array $params = []) { return $this->request->post('messages.getReactedPeers', $access_token, $params); } /** * Get assets to display message reactions * @param string $access_token * @param array $params * - @var integer client_version * @return mixed * @throws VKClientException * @throws VKApiException */ public function getReactionsAssets(string $access_token, array $params = []) { return $this->request->post('messages.getReactionsAssets', $access_token, $params); } /** * Returns information whether sending messages from the community to current user is allowed. * @param string $access_token * @param array $params * - @var integer group_id: Group ID. * - @var integer user_id: User ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesIntentCantUseException Cannot use this intent */ public function isMessagesFromGroupAllowed(string $access_token, array $params = []) { return $this->request->post('messages.isMessagesFromGroupAllowed', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string link: Invitation link. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiLimitsException Out of limits */ public function joinChatByInviteLink(string $access_token, array $params = []) { return $this->request->post('messages.joinChatByInviteLink', $access_token, $params); } /** * Marks and unmarks conversations as unanswered. * @param string $access_token * @param array $params * - @var integer peer_id: ID of conversation to mark as important. * - @var boolean answered: '1' - to mark as answered, '0' - to remove the mark * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function markAsAnsweredConversation(string $access_token, array $params = []) { return $this->request->post('messages.markAsAnsweredConversation', $access_token, $params); } /** * Marks and unmarks messages as important (starred). * @param string $access_token * @param array $params * - @var array[integer] message_ids: IDs of messages to mark as important. * - @var integer important: '1' - to add a star (mark as important), '0' - to remove the star * @return mixed * @throws VKClientException * @throws VKApiException */ public function markAsImportant(string $access_token, array $params = []) { return $this->request->post('messages.markAsImportant', $access_token, $params); } /** * Marks and unmarks conversations as important. * @param string $access_token * @param array $params * - @var integer peer_id: ID of conversation to mark as important. * - @var boolean important: '1' - to add a star (mark as important), '0' - to remove the star * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function markAsImportantConversation(string $access_token, array $params = []) { return $this->request->post('messages.markAsImportantConversation', $access_token, $params); } /** * Marks messages as read. * @param string $access_token * @param array $params * - @var array[integer] message_ids: IDs of messages to mark as read. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var integer start_message_id: Message ID to start from. * - @var integer group_id: Group ID (for group messages with user access token) * - @var boolean mark_conversation_as_read * - @var integer up_to_cmid * @return mixed * @throws VKClientException * @throws VKApiException */ public function markAsRead(string $access_token, array $params = []) { return $this->request->post('messages.markAsRead', $access_token, $params); } /** * Mark messages reactions as read * @param string $access_token * @param array $params * - @var integer peer_id * - @var array[integer] cmids * @return mixed * @throws VKClientException * @throws VKApiException */ public function markReactionsAsRead(string $access_token, array $params = []) { return $this->request->post('messages.markReactionsAsRead', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer peer_id: Chat id * - @var MessagesMuteChatMentionsMentionStatus mention_status * @return mixed * @throws VKClientException * @throws VKApiException */ public function muteChatMentions(string $access_token, array $params = []) { return $this->request->post('messages.muteChatMentions', $access_token, $params); } /** * Pin a message. * @param string $access_token * @param array $params * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " * - @var integer message_id: Message ID * - @var integer cmid: Conversation message ID * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesCantPinOneTimeStoryException Cannot pin one-time story * @throws VKApiMessagesCantPinExpiringMessageException Cannot pin an expiring message * @throws VKApiMessagesChatNotExistException Chat does not exist * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat */ public function pin(string $access_token, array $params = []) { return $this->request->post('messages.pin', $access_token, $params); } /** * Allows the current user to leave a chat or, if the current user started the chat, allows the user to remove another user from the chat. * @param string $access_token * @param array $params * - @var integer chat_id: Chat ID. * - @var integer user_id: ID of the user to be removed from the chat. * - @var integer member_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesChatUserNotInChatException User not found in chat * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesChatDisabledException Chat was disabled * @throws VKApiMessagesChatUnsupportedException Chat not supported */ public function removeChatUser(string $access_token, array $params = []) { return $this->request->post('messages.removeChatUser', $access_token, $params); } /** * Restores a deleted message. * @param string $access_token * @param array $params * - @var integer message_id: ID of a previously-deleted message to restore. * - @var integer group_id: Group ID (for group messages with user access token) * - @var integer cmid * - @var integer peer_id: Destination ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restore(string $access_token, array $params = []) { return $this->request->post('messages.restore', $access_token, $params); } /** * Returns a list of the current user's private messages that match search criteria. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var integer date: Date to search message before in Unixtime. * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." * - @var integer offset: Offset needed to return a specific subset of messages. * - @var integer count: Number of messages to return. * - @var boolean extended * - @var array[string] fields * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('messages.search', $access_token, $params); } /** * Returns a list of the current user's conversations that match search criteria. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var integer count: Maximum number of results. * - @var boolean extended: '1' - return extra information about users and communities * - @var array[MessagesSearchConversationsFields] fields: Profile fields to return. * - @var integer group_id: Group ID (for group messages with user access token) * @return mixed * @throws VKClientException * @throws VKApiException */ public function searchConversations(string $access_token, array $params = []) { return $this->request->post('messages.searchConversations', $access_token, $params); } /** * Sends a message. * @param string $access_token * @param array $params * - @var integer user_id: User ID (by default - current user). * - @var integer random_id: Unique identifier to avoid resending the message. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var array[integer] peer_ids: IDs of message recipients. (See peer_id) * - @var string domain: User's short address (for example, 'illarionov'). * - @var integer chat_id: ID of conversation the message will relate to. * - @var string message: (Required if 'attachments' is not set.) Text of the message. * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - wall post, '' - ID of the media attachment owner. '' - media attachment ID. Example: "photo100172_166443618" * - @var integer reply_to * - @var array[integer] forward_messages: ID of forwarded messages, separated with a comma. Listed messages of the sender will be shown in the message body at the recipient's. Example: "123,431,544" * - @var string forward: JSON describing the forwarded message or reply * - @var integer sticker_id: Sticker id. * - @var integer group_id: Group ID (for group messages with group access token) * - @var string keyboard * - @var string template * - @var string payload * - @var string content_source: JSON describing the content source in the message * - @var boolean dont_parse_links * - @var boolean disable_mentions * - @var MessagesSendIntent intent * - @var integer subscribe_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist * @throws VKApiMessagesDenySendException Can't send messages for users without permission * @throws VKApiMessagesPrivacyException Can't send messages to this user due to their privacy settings * @throws VKApiMessagesTooLongMessageException Message is too long * @throws VKApiMessagesTooLongForwardsException Too many forwarded messages * @throws VKApiMessagesCantFwdException Can't forward these messages * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesTooManyPostsException Too many posts in messages * @throws VKApiMessagesIntentCantUseException Cannot use this intent * @throws VKApiMessagesIntentLimitOverflowException Limits overflow for this intent * @throws VKApiMessagesChatUnsupportedException Chat not supported * @throws VKApiMessagesChatDisabledException Chat was disabled * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesPeerBlockedReasonByTimeException Can't send message, reply timed out * @throws VKApiNotFoundException Not found * @throws VKApiMessagesUserNotDonException You can't access donut chat without subscription * @throws VKApiMessagesMessageCannotBeForwardedException Message cannot be forwarded * @throws VKApiMessagesChatUserLeftException You left this chat * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat * @throws VKApiMessagesGroupForNotificationsOnlyException Cannot write to notifications only groups * @throws VKApiMessagesNeedMessageRequestException Need message request * @throws VKApiMessagesPendingMessageRequestException Pending message request */ public function send(string $access_token, array $params = []) { return $this->request->post('messages.send', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string event_id * - @var integer user_id * - @var integer peer_id * - @var string event_data * @return mixed * @throws VKClientException * @throws VKApiException */ public function sendMessageEventAnswer(string $access_token, array $params = []) { return $this->request->post('messages.sendMessageEventAnswer', $access_token, $params); } /** * Send message reaction * @param string $access_token * @param array $params * - @var integer peer_id * - @var integer cmid * - @var integer reaction_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesInvalidReactionIdException Unknown reaction passed * @throws VKApiMessagesForbiddenReactionException This reaction has been disabled * @throws VKApiMessagesReactionsLimitReachedException Reactions limit for this message has been reached */ public function sendReaction(string $access_token, array $params = []) { return $this->request->post('messages.sendReaction', $access_token, $params); } /** * Changes the status of a user as typing in a conversation. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var MessagesSetActivityType type: 'typing' - user has started to type. * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " * - @var integer group_id: Group ID (for group messages with group access token) * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesGroupPeerAccessException Your community can't interact with this peer * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat * @throws VKApiMessagesContactNotFoundException Contact not found * @throws VKApiMessagesChatNotExistException Chat does not exist */ public function setActivity(string $access_token, array $params = []) { return $this->request->post('messages.setActivity', $access_token, $params); } /** * Sets a previously-uploaded picture as the cover picture of a chat. * @param string $access_token * @param array $params * - @var string file: Upload URL from the 'response' field returned by the [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully uploading an image. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiUploadException Upload error * @throws VKApiPhotoChangedException Original photo was changed * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesChatDisabledException Chat was disabled */ public function setChatPhoto(string $access_token, array $params = []) { return $this->request->post('messages.setChatPhoto', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer peer_id * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesChatNotAdminException You are not admin of this chat * @throws VKApiMessagesChatNotExistException Chat does not exist * @throws VKApiMessagesWritingDisabledForChatException Writing is disabled for this chat */ public function unpin(string $access_token, array $params = []) { return $this->request->post('messages.unpin', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Newsfeed.php ================================================ request = $request; } /** * Prevents news from specified users and communities from appearing in the current user's newsfeed. * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var array[integer] group_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function addBan(string $access_token, array $params = []) { return $this->request->post('newsfeed.addBan', $access_token, $params); } /** * Allows news from previously banned users and communities to be shown in the current user's newsfeed. * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var array[integer] group_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteBan(string $access_token, array $params = []) { return $this->request->post('newsfeed.deleteBan', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer list_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteList(string $access_token, array $params = []) { return $this->request->post('newsfeed.deleteList', $access_token, $params); } /** * Returns data required to show newsfeed for the current user. * @param string $access_token * @param array $params * - @var array[NewsfeedGetFilters] filters: Filters to apply: 'post' - new wall posts, 'photo' - new photos, 'photo_tag' - new photo tags, 'wall_photo' - new wall photos, 'friend' - new friends * - @var boolean return_banned: '1' - to return news items from banned sources * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. * - @var integer max_photos: Maximum number of photos to return. By default, '5'. * - @var string source_ids: Sources to obtain news from, separated by commas. User IDs can be specified in formats '' or 'u' , where '' is the user's friend ID. Community IDs can be specified in formats '-' or 'g' , where '' is the community ID. If the parameter is not set, all of the user's friends and communities are returned, except for banned sources, which can be obtained with the [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. * - @var string start_from: identifier required to get the next page of results. Value for this parameter is returned in 'next_from' field in a reply. * - @var integer count: Number of news items to return (default 50, maximum 100). For auto feed, you can use the 'new_offset' parameter returned by this method. * - @var array[NewsfeedGetFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. * - @var string section * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('newsfeed.get', $access_token, $params); } /** * Returns a list of users and communities banned from the current user's newsfeed. * @param string $access_token * @param array $params * - @var boolean extended: '1' - return extra information about users and communities * - @var array[NewsfeedGetBannedFields] fields: Profile fields to return. * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default), 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * @return mixed * @throws VKClientException * @throws VKApiException */ public function getBanned(string $access_token, array $params = []) { return $this->request->post('newsfeed.getBanned', $access_token, $params); } /** * Returns a list of comments in the current user's newsfeed. * @param string $access_token * @param array $params * - @var integer count: Number of comments to return. For auto feed, you can use the 'new_offset' parameter returned by this method. * - @var array[NewsfeedGetCommentsFilters] filters: Filters to apply: 'post' - new comments on wall posts, 'photo' - new comments on photos, 'video' - new comments on videos, 'topic' - new comments on discussions, 'note' - new comments on notes, * - @var string reposts: Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the parameter is set, the 'filters' parameter is optional.), * - @var integer start_time: Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a comment to return. By default, the current time. * - @var integer last_comments_count * - @var string start_from: Identificator needed to return the next page with results. Value for this parameter returns in 'next_from' field. * - @var array[NewsfeedGetCommentsFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getComments(string $access_token, array $params = []) { return $this->request->post('newsfeed.getComments', $access_token, $params); } /** * Returns a list of newsfeeds followed by the current user. * @param string $access_token * @param array $params * - @var array[integer] list_ids: numeric list identifiers. * - @var boolean extended: Return additional list info * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLists(string $access_token, array $params = []) { return $this->request->post('newsfeed.getLists', $access_token, $params); } /** * Returns a list of posts on user walls in which the current user is mentioned. * @param string $access_token * @param array $params * - @var integer owner_id: Owner ID. * - @var integer start_time: Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a post to return. By default, the current time. * - @var integer offset: Offset needed to return a specific subset of posts. * - @var integer count: Number of posts to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getMentions(string $access_token, array $params = []) { return $this->request->post('newsfeed.getMentions', $access_token, $params); } /** * , Returns a list of newsfeeds recommended to the current user. * @param string $access_token * @param array $params * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. * - @var integer max_photos: Maximum number of photos to return. By default, '5'. * - @var string start_from: 'new_from' value obtained in previous call. * - @var integer count: Number of news items to return. * - @var array[NewsfeedGetRecommendedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getRecommended(string $access_token, array $params = []) { return $this->request->post('newsfeed.getRecommended', $access_token, $params); } /** * Returns communities and users that current user is suggested to follow. * @param string $access_token * @param array $params * - @var integer offset: offset required to choose a particular subset of communities or users. * - @var integer count: amount of communities or users to return. * - @var boolean shuffle: shuffle the returned list or not. * - @var array[NewsfeedGetSuggestedSourcesFields] fields: list of extra fields to be returned. See available fields for [vk.com/dev/fields|users] and [vk.com/dev/fields_groups|communities]. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSuggestedSources(string $access_token, array $params = []) { return $this->request->post('newsfeed.getSuggestedSources', $access_token, $params); } /** * Hides an item from the newsfeed. * @param string $access_token * @param array $params * - @var IgnoreItemType type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' - user , 'owner_id=-1' - community " * - @var integer item_id: Item identifier * @return mixed * @throws VKClientException * @throws VKApiException */ public function ignoreItem(string $access_token, array $params = []) { return $this->request->post('newsfeed.ignoreItem', $access_token, $params); } /** * Creates and edits user newsfeed lists * @param string $access_token * @param array $params * - @var integer list_id: numeric list identifier (if not sent, will be set automatically). * - @var string title: list name. * - @var array[integer] source_ids: users and communities identifiers to be added to the list. Community identifiers must be negative numbers. * - @var boolean no_reposts: reposts display on and off ('1' is for off). * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiTooManyListsException Too many feed lists */ public function saveList(string $access_token, array $params = []) { return $this->request->post('newsfeed.saveList', $access_token, $params); } /** * Returns search results by statuses. * @param string $access_token * @param array $params * - @var string q: Search query string (e.g., 'New Year'). * - @var boolean extended: '1' - to return additional information about the user or community that placed the post. * - @var integer count: Number of posts to return. * - @var number latitude: Geographical latitude point (in degrees, -90 to 90) within which to search. * - @var number longitude: Geographical longitude point (in degrees, -180 to 180) within which to search. * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. * - @var string start_from * - @var array[NewsfeedSearchFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('newsfeed.search', $access_token, $params); } /** * Returns a hidden item to the newsfeed. * @param string $access_token * @param array $params * - @var IgnoreItemType type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' - user , 'owner_id=-1' - community " * - @var integer item_id: Item identifier * - @var string track_code: Track code of unignored item * @return mixed * @throws VKClientException * @throws VKApiException */ public function unignoreItem(string $access_token, array $params = []) { return $this->request->post('newsfeed.unignoreItem', $access_token, $params); } /** * Unsubscribes the current user from specified newsfeeds. * @param string $access_token * @param array $params * - @var NewsfeedUnsubscribeType type: Type of object from which to unsubscribe: 'note' - note, 'photo' - photo, 'post' - post on user wall or community wall, 'topic' - topic, 'video' - video * - @var integer owner_id: Object owner ID. * - @var integer item_id: Object ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function unsubscribe(string $access_token, array $params = []) { return $this->request->post('newsfeed.unsubscribe', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Notes.php ================================================ request = $request; } /** * Creates a new note for the current user. * @param string $access_token * @param array $params * - @var string title: Note title. * - @var string text: Note text. * - @var array[string] privacy_view * - @var array[string] privacy_comment * @return mixed * @throws VKClientException * @throws VKApiException */ public function add(string $access_token, array $params = []) { return $this->request->post('notes.add', $access_token, $params); } /** * Adds a new comment on a note. * @param string $access_token * @param array $params * - @var integer note_id: Note ID. * - @var integer owner_id: Note owner ID. * - @var integer reply_to: ID of the user to whom the reply is addressed (if the comment is a reply to another comment). * - @var string message: Comment text. * - @var string guid * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessNoteException Access to note denied * @throws VKApiAccessNoteCommentException You can't comment this note */ public function createComment(string $access_token, array $params = []) { return $this->request->post('notes.createComment', $access_token, $params); } /** * Deletes a note of the current user. * @param string $access_token * @param array $params * - @var integer note_id: Note ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamNoteIdException Note not found */ public function delete(string $access_token, array $params = []) { return $this->request->post('notes.delete', $access_token, $params); } /** * Deletes a comment on a note. * @param string $access_token * @param array $params * - @var integer comment_id: Comment ID. * - @var integer owner_id: Note owner ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessNoteException Access to note denied * @throws VKApiAccessCommentException Access to comment denied */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('notes.deleteComment', $access_token, $params); } /** * Edits a note of the current user. * @param string $access_token * @param array $params * - @var integer note_id: Note ID. * - @var string title: Note title. * - @var string text: Note text. * - @var array[string] privacy_view * - @var array[string] privacy_comment * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamNoteIdException Note not found */ public function edit(string $access_token, array $params = []) { return $this->request->post('notes.edit', $access_token, $params); } /** * Edits a comment on a note. * @param string $access_token * @param array $params * - @var integer comment_id: Comment ID. * - @var integer owner_id: Note owner ID. * - @var string message: New comment text. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessCommentException Access to comment denied */ public function editComment(string $access_token, array $params = []) { return $this->request->post('notes.editComment', $access_token, $params); } /** * Returns a list of notes created by a user. * @param string $access_token * @param array $params * - @var array[integer] note_ids: Note IDs. * - @var integer user_id: Note owner ID. * - @var integer offset * - @var integer count: Number of notes to return. * - @var NotesGetSort sort * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamNoteIdException Note not found */ public function get(string $access_token, array $params = []) { return $this->request->post('notes.get', $access_token, $params); } /** * Returns a note by its ID. * @param string $access_token * @param array $params * - @var integer note_id: Note ID. * - @var integer owner_id: Note owner ID. * - @var boolean need_wiki * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessNoteException Access to note denied * @throws VKApiParamNoteIdException Note not found */ public function getById(string $access_token, array $params = []) { return $this->request->post('notes.getById', $access_token, $params); } /** * Returns a list of comments on a note. * @param string $access_token * @param array $params * - @var integer note_id: Note ID. * - @var integer owner_id: Note owner ID. * - @var NotesGetCommentsSort sort * - @var integer offset * - @var integer count: Number of comments to return. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessNoteException Access to note denied */ public function getComments(string $access_token, array $params = []) { return $this->request->post('notes.getComments', $access_token, $params); } /** * Restores a deleted comment on a note. * @param string $access_token * @param array $params * - @var integer comment_id: Comment ID. * - @var integer owner_id: Note owner ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessCommentException Access to comment denied */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('notes.restoreComment', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Notifications.php ================================================ request = $request; } /** * Returns a list of notifications about other users' feedback to the current user's wall posts. * @param string $access_token * @param array $params * - @var integer count: Number of notifications to return. * - @var string start_from * - @var array[NotificationsGetFilters] filters: Type of notifications to return: 'wall' - wall posts, 'mentions' - mentions in wall posts, comments, or topics, 'comments' - comments to wall posts, photos, and videos, 'likes' - likes, 'reposted' - wall posts that are copied from the current user's wall, 'followers' - new followers, 'friends' - accepted friend requests * - @var integer start_time: Earliest timestamp (in Unix time) of a notification to return. By default, 24 hours ago. * - @var integer end_time: Latest timestamp (in Unix time) of a notification to return. By default, the current time. * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('notifications.get', $access_token, $params); } /** * Resets the counter of new notifications about other users' feedback to the current user's wall posts. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function markAsViewed(string $access_token) { return $this->request->post('notifications.markAsViewed', $access_token); } /** * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var string message * - @var string fragment * - @var integer group_id * - @var integer random_id * - @var NotificationsSendMessageSendingMode sending_mode: Type of sending (delivering) notifications: 'immediately' - push and bell notifications will be delivered as soon as possible, 'delayed' - push and bell notifications will be delivered in the most comfortable time for the user, 'delayed_push' - only push notifications will be delivered in the most comfortable time, while the bell notifications will be delivered as soon as possible * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupAppIsNotInstalledInCommunityException Application is not installed in community */ public function sendMessage(string $access_token, array $params = []) { return $this->request->post('notifications.sendMessage', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Orders.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer subscription_id * - @var boolean pending_cancel * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAppsSubscriptionNotFoundException Subscription not found * @throws VKApiAppsSubscriptionInvalidStatusException Subscription is in invalid status */ public function cancelSubscription(string $access_token, array $params = []) { return $this->request->post('orders.cancelSubscription', $access_token, $params); } /** * Changes order status. * @param string $access_token * @param array $params * - @var integer order_id: order ID. * - @var OrdersChangeStateAction action: action to be done with the order. Available actions: *cancel - to cancel unconfirmed order. *charge - to confirm unconfirmed order. Applies only if processing of [vk.com/dev/payments_status|order_change_state] notification failed. *refund - to cancel confirmed order. * - @var integer app_order_id: internal ID of the order in the application. * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default - 0. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits * @throws VKApiActionFailedException Unable to process action */ public function changeState(string $access_token, array $params = []) { return $this->request->post('orders.changeState', $access_token, $params); } /** * Returns a list of orders. * @param string $access_token * @param array $params * - @var integer offset * - @var integer count: number of returned orders. * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default - 0. * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('orders.get', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var array[string] votes * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAmount(string $access_token, array $params = []) { return $this->request->post('orders.getAmount', $access_token, $params); } /** * Returns information about orders by their IDs. * @param string $access_token * @param array $params * - @var integer order_id: order ID. * - @var array[integer] order_ids: order IDs (when information about several orders is requested). * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default - 0. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('orders.getById', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * - @var integer subscription_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAppsSubscriptionNotFoundException Subscription not found */ public function getUserSubscriptionById(string $access_token, array $params = []) { return $this->request->post('orders.getUserSubscriptionById', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUserSubscriptions(string $access_token, array $params = []) { return $this->request->post('orders.getUserSubscriptions', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Pages.php ================================================ request = $request; } /** * Allows to clear the cache of particular 'external' pages which may be attached to VK posts. * @param string $access_token * @param array $params * - @var string url: Address of the page where you need to refesh the cached version * @return mixed * @throws VKClientException * @throws VKApiException */ public function clearCache(string $access_token, array $params = []) { return $this->request->post('pages.clearCache', $access_token, $params); } /** * Returns information about a wiki page. * @param string $access_token * @param array $params * - @var integer owner_id: Page owner ID. * - @var integer page_id: Wiki page ID. * - @var boolean global: '1' - to return information about a global wiki page * - @var boolean site_preview: '1' - resulting wiki page is a preview for the attached link * - @var string title: Wiki page title. * - @var boolean need_source * - @var boolean need_html: '1' - to return the page as HTML, * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('pages.get', $access_token, $params); } /** * Returns a list of all previous versions of a wiki page. * @param string $access_token * @param array $params * - @var integer page_id: Wiki page ID. * - @var integer group_id: ID of the community that owns the wiki page. * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessPageException Access to page denied * @throws VKApiParamPageIdException Page not found */ public function getHistory(string $access_token, array $params = []) { return $this->request->post('pages.getHistory', $access_token, $params); } /** * Returns a list of wiki pages in a group. * @param string $access_token * @param array $params * - @var integer group_id: ID of the community that owns the wiki page. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessPageException Access to page denied */ public function getTitles(string $access_token, array $params = []) { return $this->request->post('pages.getTitles', $access_token, $params); } /** * Returns the text of one of the previous versions of a wiki page. * @param string $access_token * @param array $params * - @var integer version_id * - @var integer group_id: ID of the community that owns the wiki page. * - @var integer user_id * - @var boolean need_html: '1' - to return the page as HTML * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessPageException Access to page denied */ public function getVersion(string $access_token, array $params = []) { return $this->request->post('pages.getVersion', $access_token, $params); } /** * Returns HTML representation of the wiki markup. * @param string $access_token * @param array $params * - @var string text: Text of the wiki page. * - @var integer group_id: ID of the group in the context of which this markup is interpreted. * @return mixed * @throws VKClientException * @throws VKApiException */ public function parseWiki(string $access_token, array $params = []) { return $this->request->post('pages.parseWiki', $access_token, $params); } /** * Saves the text of a wiki page. * @param string $access_token * @param array $params * - @var string text: Text of the wiki page in wiki-format. * - @var integer page_id: Wiki page ID. The 'title' parameter can be passed instead of 'pid'. * - @var integer group_id: ID of the community that owns the wiki page. * - @var integer user_id: User ID * - @var string title: Wiki page title. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessPageException Access to page denied * @throws VKApiParamPageIdException Page not found * @throws VKApiParamTitleException Invalid title */ public function save(string $access_token, array $params = []) { return $this->request->post('pages.save', $access_token, $params); } /** * Saves modified read and edit access settings for a wiki page. * @param string $access_token * @param array $params * - @var integer page_id: Wiki page ID. * - @var integer group_id: ID of the community that owns the wiki page. * - @var integer user_id * - @var PagesSaveAccessView view: Who can view the wiki page: '1' - only community members, '2' - all users can view the page, '0' - only community managers * - @var PagesSaveAccessEdit edit: Who can edit the wiki page: '1' - only community members, '2' - all users can edit the page, '0' - only community managers * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessPageException Access to page denied * @throws VKApiParamPageIdException Page not found */ public function saveAccess(string $access_token, array $params = []) { return $this->request->post('pages.saveAccess', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Photos.php ================================================ request = $request; } /** * Confirms a tag on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var string photo_id: Photo ID. * - @var integer tag_id: Tag ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function confirmTag(string $access_token, array $params = []) { return $this->request->post('photos.confirmTag', $access_token, $params); } /** * Allows to copy a photo to the "Saved photos" album * @param string $access_token * @param array $params * - @var integer owner_id: photo's owner ID * - @var integer photo_id: photo ID * - @var string access_key: for private photos * @return mixed * @throws VKClientException * @throws VKApiException */ public function copy(string $access_token, array $params = []) { return $this->request->post('photos.copy', $access_token, $params); } /** * Creates an empty photo album. * @param string $access_token * @param array $params * - @var string title: Album title. * - @var integer group_id: ID of the community in which the album will be created. * - @var string description: Album description. * - @var array[string] privacy_view * - @var array[string] privacy_comment * - @var boolean upload_by_admins_only * - @var boolean comments_disabled * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAlbumsLimitException Albums number limit is reached */ public function createAlbum(string $access_token, array $params = []) { return $this->request->post('photos.createAlbum', $access_token, $params); } /** * Adds a new comment on the photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var string message: Comment text. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - Media attachment owner ID. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" * - @var boolean from_group: '1' - to post a comment from the community * - @var integer reply_to_comment * - @var integer sticker_id * - @var string access_key * - @var string guid * @return mixed * @throws VKClientException * @throws VKApiException */ public function createComment(string $access_token, array $params = []) { return $this->request->post('photos.createComment', $access_token, $params); } /** * Deletes a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var array[string] photos * @return mixed * @throws VKClientException * @throws VKApiException */ public function delete(string $access_token, array $params = []) { return $this->request->post('photos.delete', $access_token, $params); } /** * Deletes a photo album belonging to the current user. * @param string $access_token * @param array $params * - @var integer album_id: Album ID. * - @var integer group_id: ID of the community that owns the album. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id */ public function deleteAlbum(string $access_token, array $params = []) { return $this->request->post('photos.deleteAlbum', $access_token, $params); } /** * Deletes a comment on the photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer comment_id: Comment ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('photos.deleteComment', $access_token, $params); } /** * Edits the caption of a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var string caption: New caption for the photo. If this parameter is not set, it is considered to be equal to an empty string. * - @var number latitude * - @var number longitude * - @var string place_str * - @var string foursquare_id * - @var boolean delete_place * @return mixed * @throws VKClientException * @throws VKApiException */ public function edit(string $access_token, array $params = []) { return $this->request->post('photos.edit', $access_token, $params); } /** * Edits information about a photo album. * @param string $access_token * @param array $params * - @var integer album_id: ID of the photo album to be edited. * - @var string title: New album title. * - @var string description: New album description. * - @var integer owner_id: ID of the user or community that owns the album. * - @var array[string] privacy_view * - @var array[string] privacy_comment * - @var boolean upload_by_admins_only * - @var boolean comments_disabled * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id */ public function editAlbum(string $access_token, array $params = []) { return $this->request->post('photos.editAlbum', $access_token, $params); } /** * Edits a comment on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer comment_id: Comment ID. * - @var string message: New text of the comment. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - Media attachment owner ID. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" * @return mixed * @throws VKClientException * @throws VKApiException */ public function editComment(string $access_token, array $params = []) { return $this->request->post('photos.editComment', $access_token, $params); } /** * Returns a list of a user's or community's photos. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photos. Use a negative value to designate a community ID. * - @var string album_id: Photo album ID. To return information about photos from service albums, use the following string values: 'profile, wall, saved'. * - @var array[string] photo_ids: Photo IDs. * - @var boolean rev: Sort order: '1' - reverse chronological, '0' - chronological * - @var boolean extended: '1' - to return additional 'likes', 'comments', and 'tags' fields, '0' - (default) * - @var string feed_type: Type of feed obtained in 'feed' field of the method. * - @var integer feed: unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] method in date field to get all photos uploaded by the user on a specific day, or photos the user has been tagged on. Also, 'uid' parameter of the user the event happened with shall be specified. * - @var boolean photo_sizes: '1' - to return photo sizes in a [vk.com/dev/photo_sizes|special format] * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('photos.get', $access_token, $params); } /** * Returns a list of a user's or community's photo albums. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the albums. * - @var array[integer] album_ids: Album IDs. * - @var integer offset: Offset needed to return a specific subset of albums. * - @var integer count: Number of albums to return. * - @var boolean need_system: '1' - to return system albums with negative IDs * - @var boolean need_covers: '1' - to return an additional 'thumb_src' field, '0' - (default) * - @var boolean photo_sizes: '1' - to return photo sizes in a * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAlbums(string $access_token, array $params = []) { return $this->request->post('photos.getAlbums', $access_token, $params); } /** * Returns the number of photo albums belonging to a user or community. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var integer group_id: Community ID. * - @var boolean need_system * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAlbumsCount(string $access_token, array $params = []) { return $this->request->post('photos.getAlbumsCount', $access_token, $params); } /** * Returns a list of photos belonging to a user or community, in reverse chronological order. * @param string $access_token * @param array $params * - @var integer owner_id: ID of a user or community that owns the photos. Use a negative value to designate a community ID. * - @var boolean extended: '1' - to return detailed information about photos * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. * - @var integer count: Number of photos to return. * - @var boolean photo_sizes: '1' - to return image sizes in [vk.com/dev/photo_sizes|special format]. * - @var boolean no_service_albums: '1' - to return photos only from standard albums, '0' - to return all photos including those in service albums, e.g., 'My wall photos' (default) * - @var boolean need_hidden: '1' - to show information about photos being hidden from the block above the wall. * - @var boolean skip_hidden: '1' - not to return photos being hidden from the block above the wall. Works only with owner_id>0, no_service_albums is ignored. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiBlockedException Content blocked */ public function getAll(string $access_token, array $params = []) { return $this->request->post('photos.getAll', $access_token, $params); } /** * Returns a list of comments on a specific photo album or all albums of the user sorted in reverse chronological order. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the album(s). * - @var integer album_id: Album ID. If the parameter is not set, comments on all of the user's albums will be returned. * - @var boolean need_likes: '1' - to return an additional 'likes' field, '0' - (default) * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. * - @var integer count: Number of comments to return. By default, '20'. Maximum value, '100'. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id */ public function getAllComments(string $access_token, array $params = []) { return $this->request->post('photos.getAllComments', $access_token, $params); } /** * Returns information about photos by their IDs. * @param string $access_token * @param array $params * - @var array[string] photos: IDs separated with a comma, that are IDs of users who posted photos and IDs of photos themselves with an underscore character between such IDs. To get information about a photo in the group album, you shall specify group ID instead of user ID. Example: "1_129207899,6492_135055734, , -20629724_271945303" * - @var boolean extended: '1' - to return additional fields, '0' - (default) * - @var boolean photo_sizes: '1' - to return photo sizes in a * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('photos.getById', $access_token, $params); } /** * Returns an upload link for chat cover pictures. * @param string $access_token * @param array $params * - @var integer chat_id: ID of the chat for which you want to upload a cover photo. * - @var integer crop_x * - @var integer crop_y * - @var integer crop_width: Width (in pixels) of the photo after cropping. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getChatUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getChatUploadServer', $access_token, $params); } /** * Returns a list of comments on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var boolean need_likes: '1' - to return an additional 'likes' field, '0' - (default) * - @var integer start_comment_id * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. * - @var integer count: Number of comments to return. * - @var PhotosGetCommentsSort sort: Sort order: 'asc' - old first, 'desc' - new first * - @var string access_key * - @var boolean extended * - @var array[PhotosGetCommentsFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function getComments(string $access_token, array $params = []) { return $this->request->post('photos.getComments', $access_token, $params); } /** * Returns the server address for market album photo upload. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMarketNotEnabledException Market not enabled */ public function getMarketAlbumUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params); } /** * Returns the server address for photo upload in a private message for a user. * @param string $access_token * @param array $params * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesDenySendException Can't send messages for users without permission */ public function getMessagesUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getMessagesUploadServer', $access_token, $params); } /** * Returns a list of photos with tags that have not been viewed. * @param string $access_token * @param array $params * - @var integer offset: Offset needed to return a specific subset of photos. * - @var integer count: Number of photos to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getNewTags(string $access_token, array $params = []) { return $this->request->post('photos.getNewTags', $access_token, $params); } /** * Returns the server address for owner cover upload. * @param string $access_token * @param array $params * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). * - @var integer crop_x: X coordinate of the left-upper corner * - @var integer crop_y: Y coordinate of the left-upper corner * - @var integer crop_x2: X coordinate of the right-bottom corner * - @var integer crop_y2: Y coordinate of the right-bottom corner * - @var boolean is_video_cover * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function getOwnerCoverPhotoUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getOwnerCoverPhotoUploadServer', $access_token, $params); } /** * Returns an upload server address for a profile or community photo. * @param string $access_token * @param array $params * - @var integer owner_id: identifier of a community or current user. "Note that community id must be negative. 'owner_id=1' - user, 'owner_id=-1' - community, " * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function getOwnerPhotoUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getOwnerPhotoUploadServer', $access_token, $params); } /** * Returns a list of tags on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var string access_key * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTags(string $access_token, array $params = []) { return $this->request->post('photos.getTags', $access_token, $params); } /** * Returns the server address for photo upload. * @param string $access_token * @param array $params * - @var integer album_id * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function getUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getUploadServer', $access_token, $params); } /** * Returns a list of photos in which a user is tagged. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. * - @var integer count: Number of photos to return. Maximum value is 1000. * - @var boolean extended: '1' - to return an additional 'likes' field, '0' - (default) * - @var string sort: Sort order: '1' - by date the tag was added in ascending order, '0' - by date the tag was added in descending order * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUserPhotos(string $access_token, array $params = []) { return $this->request->post('photos.getUserPhotos', $access_token, $params); } /** * Returns the server address for photo upload onto a user's wall. * @param string $access_token * @param array $params * - @var integer group_id: ID of community to whose wall the photo will be uploaded. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getWallUploadServer(string $access_token, array $params = []) { return $this->request->post('photos.getWallUploadServer', $access_token, $params); } /** * Makes a photo into an album cover. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var integer album_id: Album ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function makeCover(string $access_token, array $params = []) { return $this->request->post('photos.makeCover', $access_token, $params); } /** * Moves a photo from one album to another. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer target_album_id: ID of the album to which the photo will be moved. * - @var array[integer] photo_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function move(string $access_token, array $params = []) { return $this->request->post('photos.move', $access_token, $params); } /** * Adds a tag on the photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var integer user_id: ID of the user to be tagged. * - @var number x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width). * - @var number y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height). * - @var number x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width). * - @var number y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height). * @return mixed * @throws VKClientException * @throws VKApiException */ public function putTag(string $access_token, array $params = []) { return $this->request->post('photos.putTag', $access_token, $params); } /** * Removes a tag from a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var integer tag_id: Tag ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function removeTag(string $access_token, array $params = []) { return $this->request->post('photos.removeTag', $access_token, $params); } /** * Reorders the album in the list of user albums. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the album. * - @var integer album_id: Album ID. * - @var integer before: ID of the album before which the album in question shall be placed. * - @var integer after: ID of the album after which the album in question shall be placed. * @return mixed * @throws VKClientException * @throws VKApiException */ public function reorderAlbums(string $access_token, array $params = []) { return $this->request->post('photos.reorderAlbums', $access_token, $params); } /** * Reorders the photo in the list of photos of the user album. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var integer before: ID of the photo before which the photo in question shall be placed. * - @var integer after: ID of the photo after which the photo in question shall be placed. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotosException Invalid photos */ public function reorderPhotos(string $access_token, array $params = []) { return $this->request->post('photos.reorderPhotos', $access_token, $params); } /** * Reports (submits a complaint about) a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * - @var PhotosReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse, '8' - suicide calls * @return mixed * @throws VKClientException * @throws VKApiException */ public function report(string $access_token, array $params = []) { return $this->request->post('photos.report', $access_token, $params); } /** * Reports (submits a complaint about) a comment on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer comment_id: ID of the comment being reported. * - @var PhotosReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return mixed * @throws VKClientException * @throws VKApiException */ public function reportComment(string $access_token, array $params = []) { return $this->request->post('photos.reportComment', $access_token, $params); } /** * Restores a deleted photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer photo_id: Photo ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restore(string $access_token, array $params = []) { return $this->request->post('photos.restore', $access_token, $params); } /** * Restores a deleted comment on a photo. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the photo. * - @var integer comment_id: ID of the deleted comment. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('photos.restoreComment', $access_token, $params); } /** * Saves photos after successful uploading. * @param string $access_token * @param array $params * - @var integer album_id: ID of the album to save photos to. * - @var integer group_id: ID of the community to save photos to. * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var string photos_list: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). * - @var string caption: Text describing the photo. 2048 digits max. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id * @throws VKApiParamServerException Invalid server * @throws VKApiParamHashException Invalid hash * @throws VKApiUploadException Upload error */ public function save(string $access_token, array $params = []) { return $this->request->post('photos.save', $access_token, $params); } /** * Saves market album photos after successful uploading. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamHashException Invalid hash * @throws VKApiParamPhotoException Invalid photo * @throws VKApiMarketNotEnabledException Market not enabled */ public function saveMarketAlbumPhoto(string $access_token, array $params = []) { return $this->request->post('photos.saveMarketAlbumPhoto', $access_token, $params); } /** * Saves a photo after being successfully uploaded. URL obtained with [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method. * @param string $access_token * @param array $params * - @var string photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server]. * - @var integer server * - @var string hash * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id * @throws VKApiParamServerException Invalid server * @throws VKApiParamHashException Invalid hash */ public function saveMessagesPhoto(string $access_token, array $params = []) { return $this->request->post('photos.saveMessagesPhoto', $access_token, $params); } /** * Saves cover photo after successful uploading. * @param string $access_token * @param array $params * - @var integer crop_x * - @var integer crop_height * - @var integer crop_y * - @var integer crop_width * - @var string response_json * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. * - @var boolean is_video_cover * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function saveOwnerCoverPhoto(string $access_token, array $params = []) { return $this->request->post('photos.saveOwnerCoverPhoto', $access_token, $params); } /** * Saves a profile or community photo. Upload URL can be got with the [vk.com/dev/photos.getOwnerPhotoUploadServer|photos.getOwnerPhotoUploadServer] method. * @param string $access_token * @param array $params * - @var string server: parameter returned after [vk.com/dev/upload_files|photo upload]. * - @var string hash: parameter returned after [vk.com/dev/upload_files|photo upload]. * - @var string photo: parameter returned after [vk.com/dev/upload_files|photo upload]. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo * @throws VKApiGroupNeed2faException You need to enable 2FA for this action */ public function saveOwnerPhoto(string $access_token, array $params = []) { return $this->request->post('photos.saveOwnerPhoto', $access_token, $params); } /** * Saves a photo to a user's or community's wall after being uploaded. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user on whose wall the photo will be saved. * - @var integer group_id: ID of community on whose wall the photo will be saved. * - @var string photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the server]. * - @var integer server * - @var string hash * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). * - @var string caption: Text describing the photo. 2048 digits max. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamAlbumIdException Invalid album id * @throws VKApiParamServerException Invalid server * @throws VKApiParamHashException Invalid hash * @throws VKApiUploadException Upload error */ public function saveWallPhoto(string $access_token, array $params = []) { return $this->request->post('photos.saveWallPhoto', $access_token, $params); } /** * Returns a list of photos. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var number lat: Geographical latitude, in degrees (from '-90' to '90'). * - @var number long: Geographical longitude, in degrees (from '-180' to '180'). * - @var number start_time * - @var number end_time * - @var integer sort: Sort order: * - @var integer offset: Offset needed to return a specific subset of photos. * - @var integer count: Number of photos to return. * - @var integer radius: Radius of search in meters (works very approximately). Available values: '10', '100', '800', '6000', '50000'. * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('photos.search', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Podcasts.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var string search_string * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function searchPodcast(string $access_token, array $params = []) { return $this->request->post('podcasts.searchPodcast', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Polls.php ================================================ request = $request; } /** * Adds the current user's vote to the selected answer in the poll. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. * - @var integer poll_id: Poll ID. * - @var array[integer] answer_ids * - @var boolean is_board * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPollsAccessException Access to poll denied * @throws VKApiPollsAnswerIdException Invalid answer id * @throws VKApiPollsPollIdException Invalid poll id */ public function addVote(string $access_token, array $params = []) { return $this->request->post('polls.addVote', $access_token, $params); } /** * Creates polls that can be attached to the users' or communities' posts. * @param string $access_token * @param array $params * - @var string question: question text * - @var boolean is_anonymous: '1' - anonymous poll, participants list is hidden,, '0' - public poll, participants list is available,, Default value is '0'. * - @var boolean is_multiple * - @var integer end_date * - @var integer owner_id: If a poll will be added to a communty it is required to send a negative group identifier. Current user by default. * - @var integer app_id * - @var string add_answers: available answers list, for example: " ["yes","no","maybe"]", There can be from 1 to 10 answers. * - @var integer photo_id * - @var PollsCreateBackgroundId background_id * - @var boolean disable_unvote * @return mixed * @throws VKClientException * @throws VKApiException */ public function create(string $access_token, array $params = []) { return $this->request->post('polls.create', $access_token, $params); } /** * Deletes the current user's vote from the selected answer in the poll. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. * - @var integer poll_id: Poll ID. * - @var boolean is_board * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPollsAccessException Access to poll denied * @throws VKApiPollsAnswerIdException Invalid answer id * @throws VKApiPollsPollIdException Invalid poll id */ public function deleteVote(string $access_token, array $params = []) { return $this->request->post('polls.deleteVote', $access_token, $params); } /** * Edits created polls * @param string $access_token * @param array $params * - @var integer owner_id: poll owner id * - @var integer poll_id: edited poll's id * - @var string question: new question text * - @var string add_answers: answers list, for example: , "["yes","no","maybe"]" * - @var string edit_answers: object containing answers that need to be edited,, key - answer id, value - new answer text. Example: {"382967099":"option1", "382967103":"option2"}" * - @var string delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]" * - @var integer end_date * - @var integer photo_id * - @var PollsEditBackgroundId background_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function edit(string $access_token, array $params = []) { return $this->request->post('polls.edit', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getBackgrounds(string $access_token) { return $this->request->post('polls.getBackgrounds', $access_token); } /** * Returns detailed information about a poll by its ID. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. * - @var boolean is_board: '1' - poll is in a board, '0' - poll is on a wall. '0' by default. * - @var integer poll_id: Poll ID. * - @var boolean extended * - @var integer friends_count * - @var array[string] fields * - @var NameCase name_case * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPollsAccessException Access to poll denied */ public function getById(string $access_token, array $params = []) { return $this->request->post('polls.getById', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getPhotoUploadServer(string $access_token, array $params = []) { return $this->request->post('polls.getPhotoUploadServer', $access_token, $params); } /** * Returns a list of IDs of users who selected specific answers in the poll. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. * - @var integer poll_id: Poll ID. * - @var array[integer] answer_ids: Answer IDs. * - @var boolean is_board * - @var boolean friends_only: '1' - to return only current user's friends, '0' - to return all users (default), * - @var integer offset: Offset needed to return a specific subset of voters. '0' - (default) * - @var integer count: Number of user IDs to return (if the 'friends_only' parameter is not set, maximum '1000', otherwise '10'). '100' - (default) * - @var array[PollsGetVotersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. * - @var NameCase name_case: Case for declension of user name and surname: , 'nom' - nominative (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPollsAccessException Access to poll denied * @throws VKApiPollsAnswerIdException Invalid answer id * @throws VKApiPollsPollIdException Invalid poll id * @throws VKApiPollsAccessWithoutVoteException Access denied, please vote first */ public function getVoters(string $access_token, array $params = []) { return $this->request->post('polls.getVoters', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string photo * - @var string hash * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo */ public function savePhoto(string $access_token, array $params = []) { return $this->request->post('polls.savePhoto', $access_token, $params); } } ================================================ FILE: src/VK/Actions/PrettyCards.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var string photo * - @var string title * - @var string link * - @var string price * - @var string price_old * - @var string button * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPrettyCardsTooManyCardsException Too many cards */ public function create(string $access_token, array $params = []) { return $this->request->post('prettyCards.create', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer card_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPrettyCardsCardNotFoundException Card not found * @throws VKApiPrettyCardsCardIsConnectedToPostException Card is connected to post */ public function delete(string $access_token, array $params = []) { return $this->request->post('prettyCards.delete', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer card_id * - @var string photo * - @var string title * - @var string link * - @var string price * - @var string price_old * - @var string button * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiPrettyCardsCardNotFoundException Card not found */ public function edit(string $access_token, array $params = []) { return $this->request->post('prettyCards.edit', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('prettyCards.get', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var array[integer] card_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('prettyCards.getById', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUploadURL(string $access_token) { return $this->request->post('prettyCards.getUploadURL', $access_token); } } ================================================ FILE: src/VK/Actions/Search.php ================================================ request = $request; } /** * Allows the programmer to do a quick search for any substring. * @param string $access_token * @param array $params * - @var string q: Search query string. * - @var integer offset: Offset for querying specific result subset * - @var integer limit: Maximum number of results to return. * - @var array[string] filters * - @var array[string] fields * - @var boolean search_global * @return mixed * @throws VKClientException * @throws VKApiException */ public function getHints(string $access_token, array $params = []) { return $this->request->post('search.getHints', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Secure.php ================================================ request = $request; } /** * Adds user activity information to an application * @param string $access_token * @param array $params * - @var integer user_id: ID of a user to save the data * - @var integer activity_id: there are 2 default activities: , * 1 - level. Works similar to ,, * 2 - points, saves points amount, Any other value is for saving completed missions * - @var integer value: depends on activity_id: * 1 - number, current level number,, * 2 - number, current user's points amount, , Any other value is ignored * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAppsAlreadyUnlockedException This achievement is already unlocked */ public function addAppEvent(string $access_token, array $params = []) { return $this->request->post('secure.addAppEvent', $access_token, $params); } /** * Checks the user authentication in 'IFrame' and 'Flash' apps using the 'access_token' parameter. * @param string $access_token * @param array $params * - @var string token: client 'access_token' * - @var string ip: user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is required to transmit the 'ipv6' address. If not transmitted, the address will not be checked. * @return mixed * @throws VKClientException * @throws VKApiException */ public function checkToken(string $access_token, array $params = []) { return $this->request->post('secure.checkToken', $access_token, $params); } /** * Returns payment balance of the application in hundredth of a vote. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getAppBalance(string $access_token) { return $this->request->post('secure.getAppBalance', $access_token); } /** * Shows a list of SMS notifications sent by the application using [vk.com/dev/secure.sendSMSNotification|secure.sendSMSNotification] method. * @param string $access_token * @param array $params * - @var integer user_id * - @var integer date_from: filter by start date. It is set as UNIX-time. * - @var integer date_to: filter by end date. It is set as UNIX-time. * - @var integer limit: number of returned posts. By default - 1000. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSMSHistory(string $access_token, array $params = []) { return $this->request->post('secure.getSMSHistory', $access_token, $params); } /** * Shows history of votes transaction between users and the application. * @param string $access_token * @param array $params * - @var integer type * - @var integer uid_from * - @var integer uid_to * - @var integer date_from * - @var integer date_to * - @var integer limit * @return mixed * @throws VKClientException * @throws VKApiException */ public function getTransactionsHistory(string $access_token, array $params = []) { return $this->request->post('secure.getTransactionsHistory', $access_token, $params); } /** * Returns one of the previously set game levels of one or more users in the application. * @param string $access_token * @param array $params * - @var array[integer] user_ids * @return mixed * @throws VKClientException * @throws VKApiException */ public function getUserLevel(string $access_token, array $params = []) { return $this->request->post('secure.getUserLevel', $access_token, $params); } /** * Opens the game achievement and gives the user a sticker * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var integer achievement_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function giveEventSticker(string $access_token, array $params = []) { return $this->request->post('secure.giveEventSticker', $access_token, $params); } /** * Sends notification to the user. * @param string $access_token * @param array $params * - @var array[integer] user_ids * - @var integer user_id * - @var string message: notification text which should be sent in 'UTF-8' encoding ('254' characters maximum). * - @var integer notification_id * - @var integer promo_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function sendNotification(string $access_token, array $params = []) { return $this->request->post('secure.sendNotification', $access_token, $params); } /** * Sends 'SMS' notification to a user's mobile device. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user to whom SMS notification is sent. The user shall allow the application to send him/her notifications (, +1). * - @var string message: 'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are allowed. Maximum size is '160' characters. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiInsufficientFundsException Application has insufficient funds * @throws VKApiMobileNotActivatedException The mobile number of the user is unknown */ public function sendSMSNotification(string $access_token, array $params = []) { return $this->request->post('secure.sendSMSNotification', $access_token, $params); } /** * Sets a counter which is shown to the user in bold in the left menu. * @param string $access_token * @param array $params * - @var array[string] counters * - @var integer user_id * - @var integer counter: counter value. * - @var boolean increment * @return mixed * @throws VKClientException * @throws VKApiException */ public function setCounter(string $access_token, array $params = []) { return $this->request->post('secure.setCounter', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Stats.php ================================================ request = $request; } /** * Returns statistics of a community or an application. * @param string $access_token * @param array $params * - @var integer group_id: Community ID. * - @var integer app_id: Application ID. * - @var number timestamp_from * - @var number timestamp_to * - @var StatsGetInterval interval * - @var integer intervals_count * - @var array[string] filters * - @var array[string] stats_groups * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('stats.get', $access_token, $params); } /** * Returns stats for a wall post. * @param string $access_token * @param array $params * - @var integer owner_id: post owner community id. Specify with "-" sign. * - @var array[integer] post_ids: wall posts id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessPostException Access to wall's post denied */ public function getPostReach(string $access_token, array $params = []) { return $this->request->post('stats.getPostReach', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var StatsTrackVisitorType type * @return mixed * @throws VKClientException * @throws VKApiException */ public function trackVisitor(string $access_token, array $params = []) { return $this->request->post('stats.trackVisitor', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Status.php ================================================ request = $request; } /** * Returns data required to show the status of a user or community. * @param string $access_token * @param array $params * - @var integer user_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('status.get', $access_token, $params); } /** * Sets a new status for the current user. * @param string $access_token * @param array $params * - @var string text: Text of the new status. * - @var integer group_id: Identifier of a community to set a status in. If left blank the status is set to current user. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiStatusNoAudioException User disabled track name broadcast */ public function set(string $access_token, array $params = []) { return $this->request->post('status.set', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Storage.php ================================================ request = $request; } /** * Returns a value of variable with the name set by key parameter. * @param string $access_token * @param array $params * - @var string key * - @var array[string] keys * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('storage.get', $access_token, $params); } /** * Returns the names of all variables. * @param string $access_token * @param array $params * - @var integer user_id: user id, whose variables names are returned if they were requested with a server method. * - @var integer offset * - @var integer count: amount of variable names the info needs to be collected from. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getKeys(string $access_token, array $params = []) { return $this->request->post('storage.getKeys', $access_token, $params); } /** * Saves a value of variable with the name set by 'key' parameter. * @param string $access_token * @param array $params * - @var string key * - @var string value * - @var integer user_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiLimitsException Out of limits */ public function set(string $access_token, array $params = []) { return $this->request->post('storage.set', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Store.php ================================================ request = $request; } /** * Adds given sticker IDs to the list of user's favorite stickers * @param string $access_token * @param array $params * - @var array[integer] sticker_ids: Sticker IDs to be added * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiStickersNotPurchasedException Stickers are not purchased * @throws VKApiStickersTooManyFavoritesException Too many favorite stickers */ public function addStickersToFavorite(string $access_token, array $params = []) { return $this->request->post('store.addStickersToFavorite', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFavoriteStickers(string $access_token) { return $this->request->post('store.getFavoriteStickers', $access_token); } /** * @param string $access_token * @param array $params * - @var string type * - @var string merchant * - @var string section * - @var array[integer] product_ids * - @var array[string] filters * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException */ public function getProducts(string $access_token, array $params = []) { return $this->request->post('store.getProducts', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[integer] stickers_ids * - @var array[integer] products_ids * - @var boolean aliases * - @var boolean all_products * - @var boolean need_stickers * - @var boolean vmoji_promo * @return mixed * @throws VKClientException * @throws VKApiException */ public function getStickersKeywords(string $access_token, array $params = []) { return $this->request->post('store.getStickersKeywords', $access_token, $params); } /** * Removes given sticker IDs from the list of user's favorite stickers * @param string $access_token * @param array $params * - @var array[integer] sticker_ids: Sticker IDs to be removed * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiStickersNotFavoriteException Stickers are not favorite */ public function removeStickersFromFavorite(string $access_token, array $params = []) { return $this->request->post('store.removeStickersFromFavorite', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Stories.php ================================================ request = $request; } /** * Allows to hide stories from chosen sources from current user's feed. * @param string $access_token * @param array $params * - @var array[integer] owners_ids: List of sources IDs * @return mixed * @throws VKClientException * @throws VKApiException */ public function banOwner(string $access_token, array $params = []) { return $this->request->post('stories.banOwner', $access_token, $params); } /** * Allows to delete story. * @param string $access_token * @param array $params * - @var integer owner_id: Story owner's ID. Current user id is used by default. * - @var integer story_id: Story ID. * - @var array[string] stories * @return mixed * @throws VKClientException * @throws VKApiException */ public function delete(string $access_token, array $params = []) { return $this->request->post('stories.delete', $access_token, $params); } /** * Returns stories available for current user. * @param string $access_token * @param array $params * - @var integer owner_id: Owner ID. * - @var boolean extended: '1' - to return additional fields for users and communities. Default value is 0. * - @var array[StoriesGetFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('stories.get', $access_token, $params); } /** * Returns list of sources hidden from current user's feed. * @param string $access_token * @param array $params * - @var boolean extended: '1' - to return additional fields for users and communities. Default value is 0. * - @var array[StoriesGetBannedFields] fields: Additional fields to return * @return mixed * @throws VKClientException * @throws VKApiException */ public function getBanned(string $access_token, array $params = []) { return $this->request->post('stories.getBanned', $access_token, $params); } /** * Returns story by its ID. * @param string $access_token * @param array $params * - @var array[string] stories: Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for example, 12345_54331. * - @var boolean extended: '1' - to return additional fields for users and communities. Default value is 0. * - @var array[StoriesGetByIdFields] fields: Additional fields to return * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiStoryExpiredException Story has already expired */ public function getById(string $access_token, array $params = []) { return $this->request->post('stories.getById', $access_token, $params); } /** * Returns URL for uploading a story with photo. * @param string $access_token * @param array $params * - @var boolean add_to_news: 1 - to add the story to friend's feed. * - @var array[integer] user_ids: List of users IDs who can see the story. * - @var string reply_to_story: ID of the story to reply with the current. * - @var UploadLinkText link_text: Link text (for community's stories only). * - @var string link_url: Link URL. Internal links on https://vk.com only. * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). * - @var string clickable_stickers * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy * @throws VKApiBlockedException Content blocked */ public function getPhotoUploadServer(string $access_token, array $params = []) { return $this->request->post('stories.getPhotoUploadServer', $access_token, $params); } /** * Returns replies to the story. * @param string $access_token * @param array $params * - @var integer owner_id: Story owner ID. * - @var integer story_id: Story ID. * - @var string access_key: Access key for the private object. * - @var boolean extended: '1' - to return additional fields for users and communities. Default value is 0. * - @var array[StoriesGetRepliesFields] fields: Additional fields to return * @return mixed * @throws VKClientException * @throws VKApiException */ public function getReplies(string $access_token, array $params = []) { return $this->request->post('stories.getReplies', $access_token, $params); } /** * Returns stories available for current user. * @param string $access_token * @param array $params * - @var integer owner_id: Story owner ID. * - @var integer story_id: Story ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getStats(string $access_token, array $params = []) { return $this->request->post('stories.getStats', $access_token, $params); } /** * Allows to receive URL for uploading story with video. * @param string $access_token * @param array $params * - @var boolean add_to_news: 1 - to add the story to friend's feed. * - @var array[integer] user_ids: List of users IDs who can see the story. * - @var string reply_to_story: ID of the story to reply with the current. * - @var UploadLinkText link_text: Link text (for community's stories only). * - @var string link_url: Link URL. Internal links on https://vk.com only. * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). * - @var string clickable_stickers * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy * @throws VKApiBlockedException Content blocked */ public function getVideoUploadServer(string $access_token, array $params = []) { return $this->request->post('stories.getVideoUploadServer', $access_token, $params); } /** * Returns a list of story viewers. * @param string $access_token * @param array $params * - @var integer owner_id: Story owner ID. * - @var integer story_id: Story ID. * - @var integer count: Maximum number of results. * - @var integer offset: Offset needed to return a specific subset of results. * - @var boolean extended: '1' - to return detailed information about photos * - @var array[StoriesGetViewersFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiStoryExpiredException Story has already expired */ public function getViewers(string $access_token, array $params = []) { return $this->request->post('stories.getViewers', $access_token, $params); } /** * Hides all replies in the last 24 hours from the user to current user's stories. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user whose replies should be hidden. * - @var integer group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function hideAllReplies(string $access_token, array $params = []) { return $this->request->post('stories.hideAllReplies', $access_token, $params); } /** * Hides the reply to the current user's story. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user whose replies should be hidden. * - @var integer story_id: Story ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function hideReply(string $access_token, array $params = []) { return $this->request->post('stories.hideReply', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var array[string] upload_results * - @var string upload_results_json * - @var boolean extended * - @var array[StoriesSaveFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function save(string $access_token, array $params = []) { return $this->request->post('stories.save', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string q * - @var integer place_id * - @var number latitude * - @var number longitude * - @var integer radius * - @var integer mentioned_id * - @var integer count * - @var boolean extended * - @var array[StoriesSearchFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('stories.search', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string access_key * - @var string message * - @var boolean is_broadcast * - @var boolean is_anonymous * - @var boolean unseen_marker * @return mixed * @throws VKClientException * @throws VKApiException */ public function sendInteraction(string $access_token, array $params = []) { return $this->request->post('stories.sendInteraction', $access_token, $params); } /** * Allows to show stories from hidden sources in current user's feed. * @param string $access_token * @param array $params * - @var array[integer] owners_ids: List of hidden sources to show stories from. * @return mixed * @throws VKClientException * @throws VKApiException */ public function unbanOwner(string $access_token, array $params = []) { return $this->request->post('stories.unbanOwner', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Streaming.php ================================================ request = $request; } /** * Allows to receive data for the connection to Streaming API. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getServerUrl(string $access_token) { return $this->request->post('streaming.getServerUrl', $access_token); } /** * @param string $access_token * @param array $params * - @var StreamingGetStatsType type * - @var StreamingGetStatsInterval interval * - @var integer start_time * - @var integer end_time * @return mixed * @throws VKClientException * @throws VKApiException */ public function getStats(string $access_token, array $params = []) { return $this->request->post('streaming.getStats', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string word * @return mixed * @throws VKClientException * @throws VKApiException */ public function getStem(string $access_token, array $params = []) { return $this->request->post('streaming.getStem', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Translations.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var array[string] texts * - @var string translation_language * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiTranslationsCantTranslateException Can't translate. * @throws VKApiTranslationsMultipleSourceLangException Multiple source languages. Only one allowed. */ public function translate(string $access_token, array $params = []) { return $this->request->post('translations.translate', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Users.php ================================================ request = $request; } /** * Returns detailed information on users. * @param string $access_token * @param array $params * - @var array[integer]|array[string] user_ids: User IDs or screen names ('screen_name'). By default, current user ID. * - @var array[UsersGetFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', 'can_invite_to_chats' * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default), 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * - @var integer from_group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function get(string $access_token, array $params = []) { return $this->request->post('users.get', $access_token, $params); } /** * Returns a list of IDs of followers of the user in question, sorted by date added, most recent first. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var integer offset: Offset needed to return a specific subset of followers. * - @var integer count: Number of followers to return. * - @var array[UsersGetFollowersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online'. * - @var NameCase name_case: Case for declension of user name and surname: 'nom' - nominative (default), 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - prepositional * @return mixed * @throws VKClientException * @throws VKApiException */ public function getFollowers(string $access_token, array $params = []) { return $this->request->post('users.getFollowers', $access_token, $params); } /** * Returns a list of IDs of users and communities followed by the user. * @param string $access_token * @param array $params * - @var integer user_id: User ID. * - @var boolean extended: '1' - to return a combined list of users and communities, '0' - to return separate lists of users and communities (default) * - @var integer offset: Offset needed to return a specific subset of subscriptions. * - @var integer count: Number of users and communities to return. * - @var array[UsersGetSubscriptionsFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function getSubscriptions(string $access_token, array $params = []) { return $this->request->post('users.getSubscriptions', $access_token, $params); } /** * Reports (submits a complain about) a user. * @param string $access_token * @param array $params * - @var integer user_id: ID of the user about whom a complaint is being made. * - @var UsersReportType type: Type of complaint: 'porn' - pornography, 'spam' - spamming, 'insult' - abusive behavior, 'advertisement' - disruptive advertisements * - @var string comment: Comment describing the complaint. * @return mixed * @throws VKClientException * @throws VKApiException */ public function report(string $access_token, array $params = []) { return $this->request->post('users.report', $access_token, $params); } /** * Returns a list of users matching the search criteria. * @param string $access_token * @param array $params * - @var string q: Search query string (e.g., 'Vasya Babich'). * - @var UsersSearchSort sort: Sort order: '1' - by date registered, '0' - by rating * - @var integer offset: Offset needed to return a specific subset of users. * - @var integer count: Number of users to return. * - @var array[UsersSearchFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', * - @var integer city: City ID. * - @var integer city_id: City ID. Use parameter city instead * - @var integer country: Country ID. * - @var integer country_id: Country ID. Use parameter country instead * - @var string hometown: City name in a string. * - @var integer university_country: ID of the country where the user graduated. * - @var integer university: ID of the institution of higher education. * - @var integer university_year: Year of graduation from an institution of higher education. * - @var integer university_faculty: Faculty ID. * - @var integer university_chair: Chair ID. * - @var UsersSearchSex sex: '1' - female, '2' - male, '0' - any (default) * - @var UsersSearchStatus status: Relationship status: '0' - Not specified, '1' - Not married, '2' - In a relationship, '3' - Engaged, '4' - Married, '5' - It's complicated, '6' - Actively searching, '7' - In love, '8' - In a civil union * - @var integer age_from: Minimum age. * - @var integer age_to: Maximum age. * - @var integer birth_day: Day of birth. * - @var integer birth_month: Month of birth. * - @var integer birth_year: Year of birth. * - @var boolean online: '1' - online only, '0' - all users * - @var boolean has_photo: '1' - with photo only, '0' - all users * - @var integer school_country: ID of the country where users finished school. * - @var integer school_city: ID of the city where users finished school. * - @var integer school_class * - @var integer school: ID of the school. * - @var integer school_year: School graduation year. * - @var string religion: Users' religious affiliation. * - @var string company: Name of the company where users work. * - @var string position: Job position. * - @var integer group_id: ID of a community to search in communities. * - @var array[string] from_list * - @var string screen_ref * - @var integer from_group_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function search(string $access_token, array $params = []) { return $this->request->post('users.search', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Utils.php ================================================ request = $request; } /** * Checks whether a link is blocked in VK. * @param string $access_token * @param array $params * - @var string url: Link to check (e.g., 'http://google.com'). * @return mixed * @throws VKClientException * @throws VKApiException */ public function checkLink(string $access_token, array $params = []) { return $this->request->post('utils.checkLink', $access_token, $params); } /** * Deletes shortened link from user's list. * @param string $access_token * @param array $params * - @var string key: Link key (characters after vk.cc/). * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteFromLastShortened(string $access_token, array $params = []) { return $this->request->post('utils.deleteFromLastShortened', $access_token, $params); } /** * Returns a list of user's shortened links. * @param string $access_token * @param array $params * - @var integer count: Number of links to return. * - @var integer offset: Offset needed to return a specific subset of links. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getLastShortenedLinks(string $access_token, array $params = []) { return $this->request->post('utils.getLastShortenedLinks', $access_token, $params); } /** * Returns stats data for shortened link. * @param string $access_token * @param array $params * - @var string key: Link key (characters after vk.cc/). * - @var UtilsGetLinkStatsSource source: Source of scope * - @var string access_key: Access key for private link stats. * - @var UtilsGetLinkStatsInterval interval: Interval. * - @var integer intervals_count: Number of intervals to return. * - @var boolean extended: 1 - to return extended stats data (sex, age, geo). 0 - to return views number only. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function getLinkStats(string $access_token, array $params = []) { return $this->request->post('utils.getLinkStats', $access_token, $params); } /** * Returns the current time of the VK server. * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function getServerTime(string $access_token) { return $this->request->post('utils.getServerTime', $access_token); } /** * Allows to receive a link shortened via vk.cc. * @param string $access_token * @param array $params * - @var string url: URL to be shortened. * - @var boolean private: 1 - private stats, 0 - public stats. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getShortLink(string $access_token, array $params = []) { return $this->request->post('utils.getShortLink', $access_token, $params); } /** * Detects a type of object (e.g., user, community, application) and its ID by screen name. * @param string $access_token * @param array $params * - @var string screen_name: Screen name of the user, community (e.g., 'apiclub,' 'andrew', or 'rules_of_war'), or application. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiNotFoundException Not found */ public function resolveScreenName(string $access_token, array $params = []) { return $this->request->post('utils.resolveScreenName', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Video.php ================================================ request = $request; } /** * Adds a video to a user or community page. * @param string $access_token * @param array $params * - @var integer target_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. * - @var integer video_id: Video ID. * - @var integer owner_id: ID of the user or community that owns the video. Use a negative value to designate a community ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiVideoAlreadyAddedException This video is already added */ public function add(string $access_token, array $params = []) { return $this->request->post('video.add', $access_token, $params); } /** * Creates an empty album for videos. * @param string $access_token * @param array $params * - @var integer group_id: Community ID (if the album will be created in a community). * - @var string title: Album title. * - @var array[VideoAddAlbumPrivacy] privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - friends only,, *'2' - friends and friends of friends,, *'3' - "only me". * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiAlbumsLimitException Albums number limit is reached */ public function addAlbum(string $access_token, array $params = []) { return $this->request->post('video.addAlbum', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer target_id * - @var integer album_id * - @var array[integer] album_ids * - @var integer owner_id * - @var integer video_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiVideoAlreadyAddedException This video is already added */ public function addToAlbum(string $access_token, array $params = []) { return $this->request->post('video.addToAlbum', $access_token, $params); } /** * Adds a new comment on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer video_id: Video ID. * - @var string message: New comment text. * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment owner. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" * - @var boolean from_group: '1' - to post the comment from a community name (only if 'owner_id'<0) * - @var integer reply_to_comment * - @var integer sticker_id * - @var string guid * - @var string track_code * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiVideoCommentsClosedException Comments for this video are closed */ public function createComment(string $access_token, array $params = []) { return $this->request->post('video.createComment', $access_token, $params); } /** * Deletes a video from a user or community page. * @param string $access_token * @param array $params * - @var integer video_id: Video ID. * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer target_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function delete(string $access_token, array $params = []) { return $this->request->post('video.delete', $access_token, $params); } /** * Deletes a video album. * @param string $access_token * @param array $params * - @var integer group_id: Community ID (if the album is owned by a community). * - @var integer album_id: Album ID. * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function deleteAlbum(string $access_token, array $params = []) { return $this->request->post('video.deleteAlbum', $access_token, $params); } /** * Deletes a comment on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer comment_id: ID of the comment to be deleted. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('video.deleteComment', $access_token, $params); } /** * Deletes a thread on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer thread_id: ID of the main comment to be deleted as thread. * @return mixed * @throws VKClientException * @throws VKApiException */ public function deleteThread(string $access_token, array $params = []) { return $this->request->post('video.deleteThread', $access_token, $params); } /** * Edits information about a video on a user or community page. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer video_id: Video ID. * - @var string name: New video title. * - @var string desc: New video description. * - @var array[string] privacy_view: Privacy settings in a [vk.com/dev/privacy_setting|special format]. Privacy setting is available for videos uploaded to own profile by user. * - @var array[string] privacy_comment: Privacy settings for comments in a [vk.com/dev/privacy_setting|special format]. * - @var boolean no_comments: Disable comments for the group video. * - @var boolean repeat: '1' - to repeat the playback of the video, '0' - to play the video once, * - @var string ord_info * @return mixed * @throws VKClientException * @throws VKApiException */ public function edit(string $access_token, array $params = []) { return $this->request->post('video.edit', $access_token, $params); } /** * Edits the title of a video album. * @param string $access_token * @param array $params * - @var integer group_id: Community ID (if the album edited is owned by a community). * - @var integer album_id: Album ID. * - @var string title: New album title. * - @var array[VideoEditAlbumPrivacy] privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - friends only,, *'2' - friends and friends of friends,, *'3' - "only me". * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function editAlbum(string $access_token, array $params = []) { return $this->request->post('video.editAlbum', $access_token, $params); } /** * Edits the text of a comment on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer comment_id: Comment ID. * - @var string message: New comment text. * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment owner. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" * @return mixed * @throws VKClientException * @throws VKApiException */ public function editComment(string $access_token, array $params = []) { return $this->request->post('video.editComment', $access_token, $params); } /** * Returns detailed information about videos. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video(s). * - @var array[string] videos: Video IDs, in the following format: "_,_", Use a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259" * - @var integer album_id: ID of the album containing the video(s). * - @var integer count: Number of videos to return. * - @var integer offset: Offset needed to return a specific subset of videos. * - @var boolean extended: '1' - to return an extended response with additional fields * - @var array[string] fields * - @var VideoGetSortAlbum sort_album: Sort order: '0' - newest video first, '1' - oldest video first * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function get(string $access_token, array $params = []) { return $this->request->post('video.get', $access_token, $params); } /** * Returns video album info * @param string $access_token * @param array $params * - @var integer owner_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. * - @var integer album_id: Album ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function getAlbumById(string $access_token, array $params = []) { return $this->request->post('video.getAlbumById', $access_token, $params); } /** * Returns a list of video albums owned by a user or community. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video album(s). * - @var integer offset: Offset needed to return a specific subset of video albums. * - @var integer count: Number of video albums to return. * - @var boolean extended: '1' - to return additional information about album privacy settings for the current user * - @var boolean need_system * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function getAlbums(string $access_token, array $params = []) { return $this->request->post('video.getAlbums', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer target_id * - @var integer owner_id * - @var integer video_id * - @var boolean extended * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function getAlbumsByVideo(string $access_token, array $params = []) { return $this->request->post('video.getAlbumsByVideo', $access_token, $params); } /** * Returns a list of comments on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer video_id: Video ID. * - @var boolean need_likes: '1' - to return an additional 'likes' field * - @var integer start_comment_id * - @var integer offset: Offset needed to return a specific subset of comments. * - @var integer count: Number of comments to return. * - @var VideoGetCommentsSort sort: Sort order: 'asc' - oldest comment first, 'desc' - newest comment first * - @var boolean extended * - @var array[string] fields * - @var integer comment_id * - @var integer thread_items_count * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiVideoCommentsClosedException Comments for this video are closed */ public function getComments(string $access_token, array $params = []) { return $this->request->post('video.getComments', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer video_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWaitException Need wait */ public function getLongPollServer(string $access_token, array $params = []) { return $this->request->post('video.getLongPollServer', $access_token, $params); } /** * Returns oEmbed player to video * @param string $access_token * @param array $params * - @var string url: Link to video * - @var integer maxwidth: Maximum width of player * - @var integer maxheight: Maximum width of player * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiNotFoundException Not found */ public function getOembed(string $access_token, array $params = []) { return $this->request->post('video.getOembed', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function getThumbUploadUrl(string $access_token, array $params = []) { return $this->request->post('video.getThumbUploadUrl', $access_token, $params); } /** * @param string $access_token * @return mixed * @throws VKClientException * @throws VKApiException */ public function liveGetCategories(string $access_token) { return $this->request->post('video.liveGetCategories', $access_token); } /** * @param string $access_token * @param array $params * - @var integer target_id * - @var integer album_id * - @var array[integer] album_ids * - @var integer owner_id * - @var integer video_id * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function removeFromAlbum(string $access_token, array $params = []) { return $this->request->post('video.removeFromAlbum', $access_token, $params); } /** * Reorders the album in the list of user video albums. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the albums.. * - @var integer album_id: Album ID. * - @var integer before: ID of the album before which the album in question shall be placed. * - @var integer after: ID of the album after which the album in question shall be placed. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiNotFoundException Not found */ public function reorderAlbums(string $access_token, array $params = []) { return $this->request->post('video.reorderAlbums', $access_token, $params); } /** * Reorders the video in the video album. * @param string $access_token * @param array $params * - @var integer target_id: ID of the user or community that owns the album with videos. * - @var integer album_id: ID of the video album. * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer video_id: ID of the video. * - @var integer before_owner_id: ID of the user or community that owns the video before which the video in question shall be placed. * - @var integer before_video_id: ID of the video before which the video in question shall be placed. * - @var integer after_owner_id: ID of the user or community that owns the video after which the photo in question shall be placed. * - @var integer after_video_id: ID of the video after which the photo in question shall be placed. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied */ public function reorderVideos(string $access_token, array $params = []) { return $this->request->post('video.reorderVideos', $access_token, $params); } /** * Reports (submits a complaint about) a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer video_id: Video ID. * - @var VideoReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * - @var string comment: Comment describing the complaint. * - @var string search_query: (If the video was found in search results.) Search query string. * @return mixed * @throws VKClientException * @throws VKApiException */ public function report(string $access_token, array $params = []) { return $this->request->post('video.report', $access_token, $params); } /** * Reports (submits a complaint about) a comment on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer comment_id: ID of the comment being reported. * - @var VideoReportCommentReason reason: Reason for the complaint: , 0 - spam , 1 - child pornography , 2 - extremism , 3 - violence , 4 - drug propaganda , 5 - adult material , 6 - insult, abuse * @return mixed * @throws VKClientException * @throws VKApiException */ public function reportComment(string $access_token, array $params = []) { return $this->request->post('video.reportComment', $access_token, $params); } /** * Restores a previously deleted video. * @param string $access_token * @param array $params * - @var integer video_id: Video ID. * - @var integer owner_id: ID of the user or community that owns the video. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restore(string $access_token, array $params = []) { return $this->request->post('video.restore', $access_token, $params); } /** * Restores a previously deleted comment on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer comment_id: ID of the deleted comment. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('video.restoreComment', $access_token, $params); } /** * Restores a deleted thread on a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer thread_id: ID of the main comment to be deleted as thread. * @return mixed * @throws VKClientException * @throws VKApiException */ public function restoreThread(string $access_token, array $params = []) { return $this->request->post('video.restoreThread', $access_token, $params); } /** * Returns a server address (required for upload) and video data. * @param string $access_token * @param array $params * - @var string name: Name of the video. * - @var string description: Description of the video. * - @var boolean is_private: '1' - to designate the video as private (send it via a private message), the video will not appear on the user's video list and will not be available by ID for other users, '0' - not to designate the video as private * - @var boolean wallpost: '1' - to post the saved video on a user's wall, '0' - not to post the saved video on a user's wall * - @var string link: URL for embedding the video from an external website. * - @var integer group_id: ID of the community in which the video will be saved. By default, the current user's page. * - @var integer album_id: ID of the album to which the saved video will be added. * - @var array[string] privacy_view * - @var array[string] privacy_comment * - @var boolean no_comments * - @var boolean repeat: '1' - to repeat the playback of the video, '0' - to play the video once, * - @var boolean compression * - @var string ord_info * - @var boolean auto_publish * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiWallAddPostException Access to adding post denied * @throws VKApiWallAdsPublishedException Advertisement post was recently added * @throws VKApiUploadException Upload error * @throws VKApiGroupHostNeed2faException User needs to enable 2FA for this action */ public function save(string $access_token, array $params = []) { return $this->request->post('video.save', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var string thumb_json * - @var string thumb_size * - @var string random_tag * - @var integer video_id: Video ID. * - @var boolean set_thumb: If flag passed uploaded thumb will automatically set to passed video. Work only with video_id. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiParamPhotoException Invalid photo */ public function saveUploadedThumb(string $access_token, array $params = []) { return $this->request->post('video.saveUploadedThumb', $access_token, $params); } /** * Returns a list of videos under the set search criterion. * @param string $access_token * @param array $params * - @var string q: Search query string (e.g., 'The Beatles'). * - @var VideoSearchSort sort: Sort order: '1' - by duration, '2' - by relevance, '0' - by date added * - @var integer hd: If not null, only searches for high-definition videos. * - @var boolean adult: '1' - to disable the Safe Search filter, '0' - to enable the Safe Search filter * - @var boolean live * - @var array[VideoSearchFilters] filters: Filters to apply: 'youtube' - return YouTube videos only, 'vimeo' - return Vimeo videos only, 'vk' - return VK videos only, 'short' - return short videos only, 'long' - return long videos only * - @var boolean search_own * - @var integer offset: Offset needed to return a specific subset of videos. * - @var integer longer * - @var integer shorter * - @var integer count: Number of videos to return. * - @var boolean extended * - @var integer owner_id * - @var array[string] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiActionFailedException Unable to process action */ public function search(string $access_token, array $params = []) { return $this->request->post('video.search', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer video_id * - @var string name * - @var string description * - @var boolean wallpost * - @var integer group_id * - @var array[string] privacy_view * - @var array[string] privacy_comment * - @var boolean no_comments * - @var integer category_id * - @var boolean publish * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiAccessVideoException Access denied * @throws VKApiWallAddPostException Access to adding post denied * @throws VKApiWallAdsPublishedException Advertisement post was recently added */ public function startStreaming(string $access_token, array $params = []) { return $this->request->post('video.startStreaming', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer group_id * - @var integer video_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function stopStreaming(string $access_token, array $params = []) { return $this->request->post('video.stopStreaming', $access_token, $params); } /** * Unpin comment of a video. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the video. * - @var integer comment_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function unpinComment(string $access_token, array $params = []) { return $this->request->post('video.unpinComment', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Wall.php ================================================ request = $request; } /** * @param string $access_token * @param array $params * - @var string link * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallCheckLinkCantDetermineSourceException Specified link is incorrect (can't find source) */ public function checkCopyrightLink(string $access_token, array $params = []) { return $this->request->post('wall.checkCopyrightLink', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer post_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function closeComments(string $access_token, array $params = []) { return $this->request->post('wall.closeComments', $access_token, $params); } /** * Adds a comment to a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * - @var integer from_group: Group ID. * - @var string message: (Required if 'attachments' is not set.) Text of the comment. * - @var integer reply_to_comment: ID of comment to reply. * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' - Type of media ojbect: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. '' - Media ID. For example: "photo100172_166443618,photo66748_265827614" * - @var integer sticker_id: Sticker ID. * - @var string guid: Unique identifier to avoid repeated comments. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessAddReplyException Access to status replies denied * @throws VKApiWallReplyOwnerFloodException Too many replies * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden * @throws VKApiWallAccessRepliesException Access to post comments denied */ public function createComment(string $access_token, array $params = []) { return $this->request->post('wall.createComment', $access_token, $params); } /** * Deletes a post from a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: ID of the post to be deleted. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessPostException Access to wall's post denied * @throws VKApiGroupNeed2faException You need to enable 2FA for this action * @throws VKApiNotFoundException Not found */ public function delete(string $access_token, array $params = []) { return $this->request->post('wall.delete', $access_token, $params); } /** * Deletes a comment on a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * - @var integer comment_id: Comment ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessCommentException Access to wall's comment denied * @throws VKApiNotFoundException Not found */ public function deleteComment(string $access_token, array $params = []) { return $this->request->post('wall.deleteComment', $access_token, $params); } /** * Edits a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id * - @var boolean friends_only * - @var string message: (Required if 'attachments' is not set.) Text of the post. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media application owner. '' - Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error is thrown." * - @var string services * - @var boolean signed * - @var integer publish_date * - @var number lat * - @var number long * - @var integer place_id * - @var boolean mark_as_ads * - @var boolean close_comments * - @var integer donut_paid_duration * - @var integer poster_bkg_id * - @var integer poster_bkg_owner_id * - @var string poster_bkg_access_hash * - @var string copyright * - @var WallEditTopicId topic_id: Topic ID. Allowed values can be obtained from newsfeed.getPostTopics method * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAdsPostLimitReachedException Too many ads posts * @throws VKApiWallDonutException Donut is disabled */ public function edit(string $access_token, array $params = []) { return $this->request->post('wall.edit', $access_token, $params); } /** * Allows to edit hidden post. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. * - @var string message: (Required if 'attachments' is not set.) Text of the post. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media application owner. '' - Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' - post will be signed with the name of the posting user, '0' - post will not be signed (default) * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). * - @var integer place_id: ID of the location where the user was tagged. * - @var string link_button: Link button ID * - @var string link_title: Link title * - @var string link_image: Link image url * - @var string link_video: Link video ID in format "_" * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAdsPostLimitReachedException Too many ads posts */ public function editAdsStealth(string $access_token, array $params = []) { return $this->request->post('wall.editAdsStealth', $access_token, $params); } /** * Edits a comment on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * - @var integer comment_id: Comment ID. * - @var string message: New comment text. * - @var array[string] attachments: List of objects attached to the comment, in the following format: , "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment owner. '' - Media attachment ID. For example: "photo100172_166443618,photo66748_265827614" * @return mixed * @throws VKClientException * @throws VKApiException */ public function editComment(string $access_token, array $params = []) { return $this->request->post('wall.editComment', $access_token, $params); } /** * Returns a list of posts on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer|string domain: User or community short address. * - @var integer offset: Offset needed to return a specific subset of posts. * - @var integer count: Number of posts to return (maximum 100). * - @var GetFilter filter: Filter to apply: 'owner' - posts by the wall owner, 'others' - posts by someone else, 'all' - posts by the wall owner and others (default), 'postponed' - timed posts (only available for calls with an 'access_token'), 'suggests' - suggested posts on a community wall * - @var boolean extended: '1' - to return 'wall', 'profiles', and 'groups' fields, '0' - to return no additional fields (default) * - @var array[WallGetFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiBlockedException Content blocked */ public function get(string $access_token, array $params = []) { return $this->request->post('wall.get', $access_token, $params); } /** * Returns a list of posts from user or community walls by their IDs. * @param string $access_token * @param array $params * - @var array[string] posts: User or community IDs and post IDs, separated by underscores. Use a negative value to designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" * - @var boolean extended: '1' - to return user and community objects needed to display posts, '0' - no additional fields are returned (default) * - @var integer copy_history_depth: Sets the number of parent elements to include in the array 'copy_history' that is returned if the post is a repost from another wall. * - @var array[WallGetByIdFields] fields * @return mixed * @throws VKClientException * @throws VKApiException */ public function getById(string $access_token, array $params = []) { return $this->request->post('wall.getById', $access_token, $params); } /** * Returns a comment on a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer comment_id: Comment ID. * - @var boolean extended * - @var array[WallGetCommentFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessRepliesException Access to post comments denied */ public function getComment(string $access_token, array $params = []) { return $this->request->post('wall.getComment', $access_token, $params); } /** * Returns a list of comments on a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * - @var boolean need_likes: '1' - to return the 'likes' field, '0' - not to return the 'likes' field (default) * - @var integer start_comment_id * - @var integer offset: Offset needed to return a specific subset of comments. * - @var integer count: Number of comments to return (maximum 100). * - @var WallGetCommentsSort sort: Sort order: 'asc' - chronological, 'desc' - reverse chronological * - @var integer preview_length: Number of characters at which to truncate comments when previewed. By default, '90'. Specify '0' if you do not want to truncate comments. * - @var boolean extended * - @var array[WallGetCommentsFields] fields * - @var integer comment_id: Comment ID. * - @var integer thread_items_count: Count items in threads. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessRepliesException Access to post comments denied */ public function getComments(string $access_token, array $params = []) { return $this->request->post('wall.getComments', $access_token, $params); } /** * Returns information about reposts of a post on user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. By default, current user ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * - @var integer offset: Offset needed to return a specific subset of reposts. * - @var integer count: Number of reposts to return. * @return mixed * @throws VKClientException * @throws VKApiException */ public function getReposts(string $access_token, array $params = []) { return $this->request->post('wall.getReposts', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var integer owner_id * - @var integer post_id * @return mixed * @throws VKClientException * @throws VKApiException */ public function openComments(string $access_token, array $params = []) { return $this->request->post('wall.openComments', $access_token, $params); } /** * @param string $access_token * @param array $params * - @var string links * - @var boolean extended * - @var array[string] fields * - @var NameCase name_case * @return mixed * @throws VKClientException * @throws VKApiException */ public function parseAttachedLink(string $access_token, array $params = []) { return $this->request->post('wall.parseAttachedLink', $access_token, $params); } /** * Pins the post on wall. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function pin(string $access_token, array $params = []) { return $this->request->post('wall.pin', $access_token, $params); } /** * Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var boolean friends_only: '1' - post will be available to friends only, '0' - post will be available to all users (default) * - @var boolean from_group: For a community: '1' - post will be published by the community, '0' - post will be published by the user (default) * - @var string message: (Required if 'attachments' is not set.) Text of the post. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media application owner. '' - Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." * - @var string services: List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'. * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' - post will be signed with the name of the posting user, '0' - post will not be signed (default) * - @var integer publish_date: Publication date (in Unix time). If used, posting will be delayed until the set time. * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). * - @var integer place_id: ID of the location where the user was tagged. * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. * - @var string guid * - @var boolean mark_as_ads * - @var string link_title * - @var string link_photo_id * - @var boolean close_comments * - @var integer donut_paid_duration * - @var boolean mute_notifications * - @var string copyright * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAdsPublishedException Advertisement post was recently added * @throws VKApiWallAddPostException Access to adding post denied * @throws VKApiWallTooManyRecipientsException Too many recipients * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden * @throws VKApiWallAdsPostLimitReachedException Too many ads posts * @throws VKApiWallDonutException Donut is disabled */ public function post(string $access_token, array $params = []) { return $this->request->post('wall.post', $access_token, $params); } /** * Allows to create hidden post which will not be shown on the community's wall and can be used for creating an ad with type "Community post". * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var string message: (Required if 'attachments' is not set.) Text of the post. * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' - Type of media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media application owner. '' - Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' - post will be signed with the name of the posting user, '0' - post will not be signed (default) * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). * - @var integer place_id: ID of the location where the user was tagged. * - @var string guid: Unique identifier to avoid duplication the same post. * - @var string link_button: Link button ID * - @var string link_title: Link title * - @var string link_image: Link image url * - @var string link_video: Link video ID in format "_" * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAdsPublishedException Advertisement post was recently added * @throws VKApiWallAddPostException Access to adding post denied * @throws VKApiWallTooManyRecipientsException Too many recipients * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden */ public function postAdsStealth(string $access_token, array $params = []) { return $this->request->post('wall.postAdsStealth', $access_token, $params); } /** * Reports (submits a complaint about) a comment on a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the wall. * - @var integer comment_id: Comment ID. * - @var WallReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return mixed * @throws VKClientException * @throws VKApiException */ public function reportComment(string $access_token, array $params = []) { return $this->request->post('wall.reportComment', $access_token, $params); } /** * Reports (submits a complaint about) a post on a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the wall. * - @var integer post_id: Post ID. * - @var WallReportPostReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return mixed * @throws VKClientException * @throws VKApiException */ public function reportPost(string $access_token, array $params = []) { return $this->request->post('wall.reportPost', $access_token, $params); } /** * Reposts (copies) an object to a user wall or community wall. * @param string $access_token * @param array $params * - @var string object: ID of the object to be reposted on the wall. Example: "wall66748_3675" * - @var string message: Comment to be added along with the reposted object. * - @var integer group_id: Target community ID when reposting to a community. * - @var boolean mark_as_ads * - @var boolean mute_notifications * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAdsPublishedException Advertisement post was recently added * @throws VKApiWallAddPostException Access to adding post denied * @throws VKApiWallAdsPostLimitReachedException Too many ads posts */ public function repost(string $access_token, array $params = []) { return $this->request->post('wall.repost', $access_token, $params); } /** * Restores a post deleted from a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID from whose wall the post was deleted. Use a negative value to designate a community ID. * - @var integer post_id: ID of the post to be restored. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessPostException Access to wall's post denied * @throws VKApiWallAddPostException Access to adding post denied */ public function restore(string $access_token, array $params = []) { return $this->request->post('wall.restore', $access_token, $params); } /** * Restores a comment deleted from a user wall or community wall. * @param string $access_token * @param array $params * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. * - @var integer comment_id: Comment ID. * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessCommentException Access to wall's comment denied * @throws VKApiNotFoundException Not found * @throws VKApiWallCommentNotDeletedException Comment has not been deleted */ public function restoreComment(string $access_token, array $params = []) { return $this->request->post('wall.restoreComment', $access_token, $params); } /** * Allows to search posts on user or community walls. * @param string $access_token * @param array $params * - @var integer|string domain: user or community screen name. * - @var string query: search query string. * - @var boolean owners_only: '1' - returns only page owner's posts. * - @var integer count: count of posts to return. * - @var integer offset: Offset needed to return a specific subset of posts. * - @var boolean extended: show extended post info. * - @var array[WallSearchFields] fields * @return mixed * @throws VKClientException * @throws VKApiException * @throws VKApiWallAccessPostException Access to wall's post denied */ public function search(string $access_token, array $params = []) { return $this->request->post('wall.search', $access_token, $params); } /** * Unpins the post on wall. * @param string $access_token * @param array $params * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. * - @var integer post_id: Post ID. * @return mixed * @throws VKClientException * @throws VKApiException */ public function unpin(string $access_token, array $params = []) { return $this->request->post('wall.unpin', $access_token, $params); } } ================================================ FILE: src/VK/Actions/Widgets.php ================================================ request = $request; } /** * Gets a list of comments for the page added through the [vk.com/dev/Comments|Comments widget]. * @param string $access_token * @param array $params * - @var integer widget_api_id * - @var string url * - @var string page_id * - @var string order * - @var array[WidgetsGetCommentsFields] fields * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function getComments(string $access_token, array $params = []) { return $this->request->post('widgets.getComments', $access_token, $params); } /** * Gets a list of application/site pages where the [vk.com/dev/Comments|Comments widget] or [vk.com/dev/Like|Like widget] is installed. * @param string $access_token * @param array $params * - @var integer widget_api_id * - @var string order * - @var string period * - @var integer offset * - @var integer count * @return mixed * @throws VKClientException * @throws VKApiException */ public function getPages(string $access_token, array $params = []) { return $this->request->post('widgets.getPages', $access_token, $params); } } ================================================ FILE: src/VK/CallbackApi/VKCallbackApiHandler.php ================================================ audioNew($group_id, $secret, $object); break; case static::BOARD_POST_NEW: $this->boardPostNew($group_id, $secret, $object); break; case static::BOARD_POST_EDIT: $this->boardPostEdit($group_id, $secret, $object); break; case static::BOARD_POST_RESTORE: $this->boardPostRestore($group_id, $secret, $object); break; case static::BOARD_POST_DELETE: $this->boardPostDelete($group_id, $secret, $object); break; case static::CONFIRMATION: $this->confirmation($group_id, $secret, $object); break; case static::GROUP_LEAVE: $this->groupLeave($group_id, $secret, $object); break; case static::GROUP_JOIN: $this->groupJoin($group_id, $secret, $object); break; case static::GROUP_CHANGE_PHOTO: $this->groupChangePhoto($group_id, $secret, $object); break; case static::GROUP_CHANGE_SETTINGS: $this->groupChangeSettings($group_id, $secret, $object); break; case static::GROUP_OFFICERS_EDIT: $this->groupOfficersEdit($group_id, $secret, $object); break; case static::LEAD_FORMS_NEW: $this->leadFormsNew($group_id, $secret, $object); break; case static::MARKET_COMMENT_NEW: $this->marketCommentNew($group_id, $secret, $object); break; case static::MARKET_COMMENT_DELETE: $this->marketCommentDelete($group_id, $secret, $object); break; case static::MARKET_COMMENT_EDIT: $this->marketCommentEdit($group_id, $secret, $object); break; case static::MARKET_COMMENT_RESTORE: $this->marketCommentRestore($group_id, $secret, $object); break; case static::MARKET_ORDER_NEW: $this->marketOrderNew($group_id, $secret, $object); break; case static::MARKET_ORDER_EDIT: $this->marketOrderEdit($group_id, $secret, $object); break; case static::MESSAGE_NEW: $this->messageNew($group_id, $secret, $object); break; case static::MESSAGE_REPLY: $this->messageReply($group_id, $secret, $object); break; case static::MESSAGE_EDIT: $this->messageEdit($group_id, $secret, $object); break; case static::MESSAGE_ALLOW: $this->messageAllow($group_id, $secret, $object); break; case static::MESSAGE_DENY: $this->messageDeny($group_id, $secret, $object); break; case static::MESSAGE_READ: $this->messageRead($group_id, $secret, $object); break; case static::MESSAGE_TYPING_STATE: $this->messageTypingState($group_id, $secret, $object); break; case static::MESSAGES_EDIT: $this->messagesEdit($group_id, $secret, $object); break; case static::MESSAGE_REACTION_EVENT: $this->messageReactionEvent($group_id, $secret, $object); break; case static::PHOTO_NEW: $this->photoNew($group_id, $secret, $object); break; case static::PHOTO_COMMENT_NEW: $this->photoCommentNew($group_id, $secret, $object); break; case static::PHOTO_COMMENT_DELETE: $this->photoCommentDelete($group_id, $secret, $object); break; case static::PHOTO_COMMENT_EDIT: $this->photoCommentEdit($group_id, $secret, $object); break; case static::PHOTO_COMMENT_RESTORE: $this->photoCommentRestore($group_id, $secret, $object); break; case static::POLL_VOTE_NEW: $this->pollVoteNew($group_id, $secret, $object); break; case static::USER_BLOCK: $this->userBlock($group_id, $secret, $object); break; case static::USER_UNBLOCK: $this->userUnblock($group_id, $secret, $object); break; case static::VIDEO_NEW: $this->videoNew($group_id, $secret, $object); break; case static::VIDEO_COMMENT_NEW: $this->videoCommentNew($group_id, $secret, $object); break; case static::VIDEO_COMMENT_DELETE: $this->videoCommentDelete($group_id, $secret, $object); break; case static::VIDEO_COMMENT_EDIT: $this->videoCommentEdit($group_id, $secret, $object); break; case static::VIDEO_COMMENT_RESTORE: $this->videoCommentRestore($group_id, $secret, $object); break; case static::WALL_POST_NEW: $this->wallPostNew($group_id, $secret, $object); break; case static::WALL_REPLY_NEW: $this->wallReplyNew($group_id, $secret, $object); break; case static::WALL_REPLY_EDIT: $this->wallReplyEdit($group_id, $secret, $object); break; case static::WALL_REPLY_DELETE: $this->wallReplyDelete($group_id, $secret, $object); break; case static::WALL_REPLY_RESTORE: $this->wallReplyRestore($group_id, $secret, $object); break; case static::WALL_REPOST: $this->wallRepost($group_id, $secret, $object); break; case static::WALL_SCHEDULE_POST_NEW: $this->wallSchedulePostNew($group_id, $secret, $object); break; case static::WALL_SCHEDULE_POST_DELETE: $this->wallSchedulePostDelete($group_id, $secret, $object); break; } } } ================================================ FILE: src/VK/CallbackApi/VKCallbackApiLongPollExecutor.php ================================================ api_client = $api_client; $this->http_client = $client ?: new Client([ 'timeout' => static::CONNECTION_TIMEOUT, ]); $this->access_token = $access_token; $this->group_id = $group_id; $this->handler = $handler; $this->wait = $wait; } /** * Starts listening to LongPoll events. * * @param int|null $ts * * @return null * @throws VKLongPollServerTsException * @throws VKApiException * @throws VKClientException */ public function listen(?int $ts = null) { if ($this->server === null) { $this->server = $this->getLongPollServer(); } if ($this->last_ts === null) { $this->last_ts = $this->server[static::SERVER_TIMESTAMP]; } if ($ts === null) { $ts = $this->last_ts; } try { $response = $this->getEvents($this->server[static::SERVER_URL], $this->server[static::SERVER_KEY], $ts); foreach ($response[static::EVENTS_UPDATES] as $event) { $this->handler->parseObject($this->group_id, null, $event[static::EVENT_TYPE], $event[static::EVENT_OBJECT]); } $this->last_ts = $response[static::EVENTS_TS]; } catch (VKLongPollServerKeyExpiredException $e) { $this->server = $this->getLongPollServer(); } return $this->last_ts; } /** * Get long poll server * * @return array * @throws VKApiException * @throws VKClientException */ protected function getLongPollServer() { $params = array( static::PARAM_GROUP_ID => $this->group_id ); $server = $this->api_client->groups()->getLongPollServer($this->access_token, $params); return array( static::SERVER_URL => $server['server'], static::SERVER_TIMESTAMP => $server['ts'], static::SERVER_KEY => $server['key'], ); } /** * Retrieves events from long poll server starting from the specified timestamp. * * @param string $host * @param string $key * @param int $ts * @return mixed * * @throws VKClientException * @throws VKLongPollServerKeyExpiredException * @throws VKLongPollServerTsException * @throws JsonException */ public function getEvents(string $host, string $key, int $ts) { $params = array( static::PARAM_KEY => $key, static::PARAM_TS => $ts, static::PARAM_WAIT => $this->wait, static::PARAM_ACT => static::VALUE_ACT ); $url = $host . '?' . http_build_query($params); try { $response = $this->http_client->get($url); } catch (GuzzleException $exception) { throw new VKClientException($exception); } return $this->parseResponse($params, $response); } /** * Decodes the LongPoll response and checks its status code and whether it has a failed key. * * @param array $params * @param ResponseInterface $response * @return array * * @throws VKClientException * @throws VKLongPollServerKeyExpiredException * @throws VKLongPollServerTsException * @throws JsonException */ private function parseResponse(array $params, ResponseInterface $response) { if ($response->getStatusCode() !== static::HTTP_STATUS_CODE_OK) { throw new VKClientException('Invalid http status: ' . $response->getStatusCode()); } $body = $response->getBody(); $decode_body = (array)json_decode($body, true, 512, JSON_THROW_ON_ERROR); if (array_key_exists(static::EVENTS_FAILED, $decode_body)) { switch ($decode_body[static::EVENTS_FAILED]) { case static::ERROR_CODE_INCORRECT_TS_VALUE: $ts = $params[static::PARAM_TS]; $msg = '\'ts\' value is incorrect, minimal value is 1, maximal value is ' . $ts; throw new VKLongPollServerTsException($msg); case static::ERROR_CODE_TOKEN_EXPIRED: throw new VKLongPollServerKeyExpiredException('Try to generate a new key.'); default: throw new VKClientException('Unknown LongPollServer exception, something went wrong: ' . $body); } } return $decode_body; } } ================================================ FILE: src/VK/CallbackApi/VKCallbackApiServerHandler.php ================================================ type == static::CALLBACK_EVENT_CONFIRMATION) { $this->confirmation($event->group_id, $event->secret); } else { parent::parseObject($event->group_id, $event->secret, $event->type, (array)$event->object); } } } ================================================ FILE: src/VK/Client/Actions/ActionInterface.php ================================================ */ private array $instances = []; /** * VKApiClient constructor. * @param string $api_version * @param string|null $language * @param ClientInterface|null $client */ public function __construct(string $api_version = self::API_VERSION, ?string $language = null, ?ClientInterface $client = null) { $this->request = new VKApiRequest($api_version, $language, self::API_HOST, $client); } /** * @return VKApiRequest */ public function getRequest(): VKApiRequest { return $this->request; } /** * @param string $name * @param array $_ * @return ActionInterface * @throws VKApiException */ public function __call(string $name, array $_): ActionInterface { $name = strtolower($name); $class = '\\VK\\Actions\\' . ucfirst($name); if (!class_exists($class)) { throw new VKApiException(0, "Class {$class} not found"); } if (!array_key_exists($name, $this->instances)) { $this->instances[$name] = new $class($this->request); } return $this->instances[$name]; } } ================================================ FILE: src/VK/Client/VKApiError.php ================================================ |null */ protected ?array $request_params = null; /** * VKApiError constructor. * @param array $error */ public function __construct(array $error) { if (array_key_exists(static::ERROR_CODE, $error)) { $this->error_code = (int)$error[static::ERROR_CODE]; } if (array_key_exists(static::ERROR_MSG, $error)) { $this->error_msg = (string)$error[static::ERROR_MSG]; } if (array_key_exists(self::CAPTCHA_SID, $error)) { $this->captcha_sid = (string)$error[static::CAPTCHA_SID]; } if (array_key_exists(static::CAPTCHA_IMG, $error)) { $this->captcha_img = (string)$error[static::CAPTCHA_IMG]; } if (array_key_exists(static::CONFIRMATION_TEXT, $error)) { $this->confirmation_text = (string)$error[static::CONFIRMATION_TEXT]; } if (array_key_exists(static::REDIRECT_URI, $error)) { $this->redirect_uri = (string)$error[static::REDIRECT_URI]; } if (array_key_exists(static::REQUEST_PARAMS, $error)) { $this->request_params = (array)$error[static::REQUEST_PARAMS]; } } /** * Error code * * @return int|null */ public function getErrorCode(): ?int { return $this->error_code; } /** * Error message * * @return string|null */ public function getErrorMsg(): ?string { return $this->error_msg; } /** * Captcha SID * * @return string|null */ public function getCaptchaSid(): ?string { return $this->captcha_sid; } /** * Captcha image url * * @return string|null */ public function getCaptchaImg(): ?string { return $this->captcha_img; } /** * Confirmation text * * @return string|null */ public function getConfirmationText(): ?string { return $this->confirmation_text; } /** * Redirect URI * * @return string|null */ public function getRedirectUri(): ?string { return $this->redirect_uri; } /** * Request params * * @return array|null */ public function getRequestParams(): ?array { return $this->request_params; } } ================================================ FILE: src/VK/Client/VKApiRequest.php ================================================ version = $api_version; $this->host = $host; $this->language = $language; $this->client = $client ?: new Client([ 'base_uri' => $host, 'timeout' => static::CONNECTION_TIMEOUT, ]); } /** * Makes post request. * * @param string $method * @param string $access_token * @param array $params * * @return mixed * * @throws VKClientException * @throws VKApiException */ public function post(string $method, string $access_token, array $params = []) { $params = $this->formatParams($params); $params[static::PARAM_ACCESS_TOKEN] = $access_token; if (!isset($params[static::PARAM_VERSION])) { $params[static::PARAM_VERSION] = $this->version; } if ($this->language && !isset($params[static::PARAM_LANG])) { $params[static::PARAM_LANG] = $this->language; } try { $response = $this->client->post("{$this->host}/{$method}", [ 'body' => http_build_query($params), ]); } catch (GuzzleException $exception) { throw new VKClientException($exception); } return $this->parseResponse($response); } /** * Uploads data by its path to the given url. * * @param string $upload_url * @param string $parameter_name * @param string $path * * @return mixed * * @throws VKClientException * @throws VKApiException */ public function upload(string $upload_url, string $parameter_name, string $path) { try { $response = $this->client->post($upload_url, [ 'multipart' => [ [ 'name' => $parameter_name, 'contents' => Utils::tryFopen($path, 'rb'), ], ], ]); } catch (GuzzleException $exception) { throw new VKClientException($exception); } return $this->parseResponse($response); } /** * Decodes the response and checks its status code and whether it has an Api error. Returns decoded response. * * @param ResponseInterface $response * * @return mixed * * @throws VKApiException * @throws VKClientException */ private function parseResponse(ResponseInterface $response) { if ($response->getStatusCode() !== static::HTTP_STATUS_CODE_OK) { throw new VKClientException("Invalid http status: {$response->getStatusCode()}"); } $body = $response->getBody()->getContents(); $decode_body = $this->decodeBody($body); if (isset($decode_body[static::KEY_ERROR])) { $error = $decode_body[static::KEY_ERROR]; $api_error = new VKApiError($error); throw ExceptionMapper::parse($api_error); } if (isset($decode_body[static::KEY_RESPONSE])) { return $decode_body[static::KEY_RESPONSE]; } return $decode_body; } /** * Formats given array of parameters for making the request. * * @param array $params * * @return array */ private function formatParams(array $params): array { foreach ($params as $key => $value) { if (is_array($value)) { $params[$key] = implode(',', $value); } elseif (is_bool($value)) { $params[$key] = $value ? 1 : 0; } } return $params; } /** * Decodes body. * * @param string $body * * @return mixed */ protected function decodeBody(string $body) { $decoded_body = json_decode($body, true); if (!is_array($decoded_body)) { $decoded_body = []; } return $decoded_body; } } ================================================ FILE: src/VK/Enums/AccountGetBannedFields.php ================================================ getErrorCode()) { case 1: return new VKApiUnknownException($error); case 2: return new VKApiDisabledException($error); case 3: return new VKApiMethodException($error); case 4: return new VKApiSignatureException($error); case 5: return new VKApiAuthException($error); case 6: return new VKApiTooManyException($error); case 7: return new VKApiPermissionException($error); case 8: return new VKApiRequestException($error); case 9: return new VKApiFloodException($error); case 10: return new VKApiServerException($error); case 11: return new VKApiEnabledInTestException($error); case 12: return new VKApiCompileException($error); case 13: return new VKApiRuntimeException($error); case 14: return new VKApiCaptchaException($error); case 15: return new VKApiAccessException($error); case 16: return new VKApiAuthHttpsException($error); case 17: return new VKApiAuthValidationException($error); case 18: return new VKApiUserDeletedException($error); case 19: return new VKApiBlockedException($error); case 20: return new VKApiMethodPermissionException($error); case 21: return new VKApiMethodAdsException($error); case 22: return new VKApiUploadException($error); case 23: return new VKApiMethodDisabledException($error); case 24: return new VKApiNeedConfirmationException($error); case 25: return new VKApiNeedTokenConfirmationException($error); case 27: return new VKApiGroupAuthException($error); case 28: return new VKApiAppAuthException($error); case 29: return new VKApiRateLimitException($error); case 30: return new VKApiPrivateProfileException($error); case 32: return new VKApiWaitException($error); case 33: return new VKApiNotImplementedYetException($error); case 34: return new VKApiClientVersionDeprecatedException($error); case 35: return new VKApiClientUpdateNeededException($error); case 36: return new VKApiTimeoutException($error); case 37: return new VKApiUserBannedException($error); case 38: return new VKApiUnknownApplicationException($error); case 39: return new VKApiUnknownUserException($error); case 40: return new VKApiUnknownGroupException($error); case 41: return new VKApiAdditionalSignupRequiredException($error); case 42: return new VKApiIpIsNotAllowedException($error); case 43: return new VKApiSectionDisabledException($error); case 100: return new VKApiParamException($error); case 101: return new VKApiParamApiIdException($error); case 103: return new VKApiLimitsException($error); case 104: return new VKApiNotFoundException($error); case 105: return new VKApiSaveFileException($error); case 106: return new VKApiActionFailedException($error); case 113: return new VKApiParamUserIdException($error); case 114: return new VKApiParamAlbumIdException($error); case 118: return new VKApiParamServerException($error); case 119: return new VKApiParamTitleException($error); case 121: return new VKApiParamHashException($error); case 122: return new VKApiParamPhotosException($error); case 125: return new VKApiParamGroupIdException($error); case 129: return new VKApiParamPhotoException($error); case 140: return new VKApiParamPageIdException($error); case 141: return new VKApiAccessPageException($error); case 146: return new VKApiMobileNotActivatedException($error); case 147: return new VKApiInsufficientFundsException($error); case 150: return new VKApiParamTimestampException($error); case 171: return new VKApiFriendsListIdException($error); case 173: return new VKApiFriendsListLimitException($error); case 174: return new VKApiFriendsAddYourselfException($error); case 175: return new VKApiFriendsAddInEnemyException($error); case 176: return new VKApiFriendsAddEnemyException($error); case 177: return new VKApiFriendsAddNotFoundException($error); case 180: return new VKApiParamNoteIdException($error); case 181: return new VKApiAccessNoteException($error); case 182: return new VKApiAccessNoteCommentException($error); case 183: return new VKApiAccessCommentException($error); case 200: return new VKApiAccessAlbumException($error); case 201: return new VKApiAccessAudioException($error); case 203: return new VKApiAccessGroupException($error); case 204: return new VKApiAccessVideoException($error); case 205: return new VKApiAccessMarketException($error); case 210: return new VKApiWallAccessPostException($error); case 211: return new VKApiWallAccessCommentException($error); case 212: return new VKApiWallAccessRepliesException($error); case 213: return new VKApiWallAccessAddReplyException($error); case 214: return new VKApiWallAddPostException($error); case 219: return new VKApiWallAdsPublishedException($error); case 220: return new VKApiWallTooManyRecipientsException($error); case 221: return new VKApiStatusNoAudioException($error); case 222: return new VKApiWallLinksForbiddenException($error); case 223: return new VKApiWallReplyOwnerFloodException($error); case 224: return new VKApiWallAdsPostLimitReachedException($error); case 225: return new VKApiWallDonutException($error); case 232: return new VKApiLikesReactionCanNotBeAppliedException($error); case 242: return new VKApiFriendsTooManyFriendsException($error); case 243: return new VKApiWallCommentNotDeletedException($error); case 250: return new VKApiPollsAccessException($error); case 251: return new VKApiPollsPollIdException($error); case 252: return new VKApiPollsAnswerIdException($error); case 253: return new VKApiPollsAccessWithoutVoteException($error); case 260: return new VKApiAccessGroupsException($error); case 300: return new VKApiAlbumFullException($error); case 302: return new VKApiAlbumsLimitException($error); case 500: return new VKApiVotesPermissionException($error); case 600: return new VKApiAdsPermissionException($error); case 601: return new VKApiWeightedFloodException($error); case 602: return new VKApiAdsPartialSuccessException($error); case 603: return new VKApiAdsSpecificException($error); case 629: return new VKApiAdsObjectDeletedException($error); case 630: return new VKApiAdsLookalikeRequestAlreadyInProgressException($error); case 631: return new VKApiAdsLookalikeRequestMaxCountPerDayReachedException($error); case 632: return new VKApiAdsLookalikeRequestAudienceTooSmallException($error); case 633: return new VKApiAdsLookalikeRequestAudienceTooLargeException($error); case 634: return new VKApiAdsLookalikeRequestExportAlreadyInProgressException($error); case 635: return new VKApiAdsLookalikeRequestExportMaxCountPerDayReachedException($error); case 636: return new VKApiAdsLookalikeRequestExportRetargetingGroupLimitException($error); case 700: return new VKApiGroupChangeCreatorException($error); case 701: return new VKApiGroupNotInClubException($error); case 702: return new VKApiGroupTooManyOfficersException($error); case 703: return new VKApiGroupNeed2faException($error); case 704: return new VKApiGroupHostNeed2faException($error); case 706: return new VKApiGroupTooManyAddressesException($error); case 711: return new VKApiGroupAppIsNotInstalledInCommunityException($error); case 714: return new VKApiGroupInviteLinksNotValidException($error); case 800: return new VKApiVideoAlreadyAddedException($error); case 801: return new VKApiVideoCommentsClosedException($error); case 900: return new VKApiMessagesUserBlockedException($error); case 901: return new VKApiMessagesDenySendException($error); case 902: return new VKApiMessagesPrivacyException($error); case 907: return new VKApiMessagesTooOldPtsException($error); case 908: return new VKApiMessagesTooNewPtsException($error); case 909: return new VKApiMessagesEditExpiredException($error); case 910: return new VKApiMessagesTooBigException($error); case 911: return new VKApiMessagesKeyboardInvalidException($error); case 912: return new VKApiMessagesChatBotFeatureException($error); case 913: return new VKApiMessagesTooLongForwardsException($error); case 914: return new VKApiMessagesTooLongMessageException($error); case 917: return new VKApiMessagesChatUserNoAccessException($error); case 919: return new VKApiMessagesCantSeeInviteLinkException($error); case 920: return new VKApiMessagesEditKindDisallowedException($error); case 921: return new VKApiMessagesCantFwdException($error); case 922: return new VKApiMessagesChatUserLeftException($error); case 924: return new VKApiMessagesCantDeleteForAllException($error); case 925: return new VKApiMessagesChatNotAdminException($error); case 927: return new VKApiMessagesChatNotExistException($error); case 931: return new VKApiMessagesCantChangeInviteLinkException($error); case 932: return new VKApiMessagesGroupPeerAccessException($error); case 935: return new VKApiMessagesChatUserNotInChatException($error); case 936: return new VKApiMessagesContactNotFoundException($error); case 939: return new VKApiMessagesMessageRequestAlreadySentException($error); case 940: return new VKApiMessagesTooManyPostsException($error); case 942: return new VKApiMessagesCantPinOneTimeStoryException($error); case 943: return new VKApiMessagesIntentCantUseException($error); case 944: return new VKApiMessagesIntentLimitOverflowException($error); case 945: return new VKApiMessagesChatDisabledException($error); case 946: return new VKApiMessagesChatUnsupportedException($error); case 947: return new VKApiMessagesMemberAccessToGroupDeniedException($error); case 949: return new VKApiMessagesCantEditPinnedYetException($error); case 950: return new VKApiMessagesPeerBlockedReasonByTimeException($error); case 962: return new VKApiMessagesUserNotDonException($error); case 969: return new VKApiMessagesMessageCannotBeForwardedException($error); case 970: return new VKApiMessagesCantPinExpiringMessageException($error); case 985: return new VKApiMessagesGroupForNotificationsOnlyException($error); case 987: return new VKApiMessagesNeedMessageRequestException($error); case 988: return new VKApiMessagesPendingMessageRequestException($error); case 990: return new VKApiMessagesDropDeviceCacheException($error); case 1009: return new VKApiMessagesInvalidReactionIdException($error); case 1010: return new VKApiMessagesForbiddenReactionException($error); case 1011: return new VKApiMessagesReactionsLimitReachedException($error); case 1012: return new VKApiMessagesWritingDisabledForChatException($error); case 1105: return new VKApiAuthFloodException($error); case 1114: return new VKApiAuthAnonymousTokenHasExpiredException($error); case 1116: return new VKApiAuthAnonymousTokenIsInvalidException($error); case 1117: return new VKApiAuthAccessTokenHasExpiredException($error); case 1118: return new VKApiAuthAnonymousTokenIpMismatchException($error); case 1150: return new VKApiParamDocIdException($error); case 1151: return new VKApiParamDocDeleteAccessException($error); case 1152: return new VKApiParamDocTitleException($error); case 1153: return new VKApiParamDocAccessException($error); case 1154: return new VKApiParamDocRestoreAccessException($error); case 1155: return new VKApiParamDocRestoreTimeoutException($error); case 1160: return new VKApiPhotoChangedException($error); case 1170: return new VKApiTooManyListsException($error); case 1251: return new VKApiAppsAlreadyUnlockedException($error); case 1256: return new VKApiAppsSubscriptionNotFoundException($error); case 1257: return new VKApiAppsSubscriptionInvalidStatusException($error); case 1260: return new VKApiInvalidAddressException($error); case 1400: return new VKApiMarketRestoreTooLateException($error); case 1401: return new VKApiMarketCommentsClosedException($error); case 1402: return new VKApiMarketAlbumNotFoundException($error); case 1403: return new VKApiMarketItemNotFoundException($error); case 1404: return new VKApiMarketItemAlreadyAddedException($error); case 1405: return new VKApiMarketTooManyItemsException($error); case 1406: return new VKApiMarketTooManyItemsInAlbumException($error); case 1407: return new VKApiMarketTooManyAlbumsException($error); case 1408: return new VKApiMarketItemHasBadLinksException($error); case 1409: return new VKApiMarketExtendedNotEnabledException($error); case 1410: return new VKApiMarketVariantsNotEnabledException($error); case 1411: return new VKApiMarketVariantsException($error); case 1412: return new VKApiMarketGroupingItemsWithDifferentPropertiesException($error); case 1413: return new VKApiMarketGroupingAlreadyHasSuchVariantException($error); case 1414: return new VKApiMarketGroupingHasOtherPropertiesException($error); case 1415: return new VKApiMarketGroupingMustHaveVariantsException($error); case 1416: return new VKApiMarketVariantNotFoundException($error); case 1417: return new VKApiMarketPropertyNotFoundException($error); case 1418: return new VKApiMarketMaxPropertiesLimitExceedException($error); case 1419: return new VKApiMarketMaxVariantsLimitExceedException($error); case 1421: return new VKApiMarketNameTooLongException($error); case 1423: return new VKApiMarketVariantValueTooLongException($error); case 1424: return new VKApiMarketUnknownPropertyTypeException($error); case 1425: return new VKApiMarketGroupingMustContainMoreThanOneItemException($error); case 1426: return new VKApiMarketGroupingItemsMustHaveDistinctPropertiesException($error); case 1427: return new VKApiMarketOrdersNoCartItemsException($error); case 1429: return new VKApiMarketInvalidDimensionsException($error); case 1430: return new VKApiMarketCantChangeVkpayStatusException($error); case 1431: return new VKApiMarketShopAlreadyEnabledException($error); case 1432: return new VKApiMarketShopAlreadyDisabledException($error); case 1433: return new VKApiMarketPhotosCropInvalidFormatException($error); case 1434: return new VKApiMarketPhotosCropOverflowException($error); case 1435: return new VKApiMarketPhotosCropSizeTooLowException($error); case 1436: return new VKApiMarketOrdersOrderNotFoundException($error); case 1438: return new VKApiMarketNotEnabledException($error); case 1446: return new VKApiMarketAlbumMainHiddenException($error); case 1456: return new VKApiMarketOrdersInvalidStatusException($error); case 1457: return new VKApiMarketFailedToSetAlbumAsMainException($error); case 1458: return new VKApiMarketFailedToUnsetAlbumAsMainException($error); case 1518: return new VKApiMarketItemIsNotDeletedException($error); case 1525: return new VKApiMarketDisabledException($error); case 1526: return new VKApiMarketServicesDisabledException($error); case 1531: return new VKApiMarketAddToServiceAlbumException($error); case 1532: return new VKApiMarketAddToMarketAlbumException($error); case 1600: return new VKApiStoryExpiredException($error); case 1602: return new VKApiStoryIncorrectReplyPrivacyException($error); case 1900: return new VKApiPrettyCardsCardNotFoundException($error); case 1901: return new VKApiPrettyCardsTooManyCardsException($error); case 1902: return new VKApiPrettyCardsCardIsConnectedToPostException($error); case 2000: return new VKApiCallbackApiServersLimitException($error); case 2100: return new VKApiStickersNotPurchasedException($error); case 2101: return new VKApiStickersTooManyFavoritesException($error); case 2102: return new VKApiStickersNotFavoriteException($error); case 3102: return new VKApiWallCheckLinkCantDetermineSourceException($error); case 3300: return new VKApiRecaptchaException($error); case 3301: return new VKApiPhoneValidationNeedException($error); case 3302: return new VKApiPasswordValidationNeedException($error); case 3303: return new VKApiOtpValidationNeedException($error); case 3304: return new VKApiEmailConfirmationNeedException($error); case 3305: return new VKApiAssertVotesException($error); case 3609: return new VKApiTokenExtensionRequiredException($error); case 3610: return new VKApiUserDeactivatedException($error); case 3611: return new VKApiUserServiceDeactivatedException($error); case 3800: return new VKApiFaveAliexpressTagException($error); case 9999: return new VKApiNotSupportedHttpMethodException($error); case 11500: return new VKApiCuaConfirmationRequiredException($error); case 11003: return new VKApiAppsEmptyFilterParamsException($error); case 11004: return new VKApiAppsEmptySnippetDataException($error); case 11005: return new VKApiAppsTooManySnippetsException($error); case 11006: return new VKApiAppsNotFoundSnippetException($error); case 11101: return new VKApiTranslationsCantTranslateException($error); case 11102: return new VKApiTranslationsMultipleSourceLangException($error); default: return new VKApiException($error->getErrorCode(), $error->getErrorMsg(), $error);} } } ================================================ FILE: src/VK/Exceptions/Api/VKApiAccessAlbumException.php ================================================ error_code = $error_code; $this->description = $description; $this->error_message = $error->getErrorMsg(); $this->error = $error; parent::__construct($error->getErrorMsg(), $error_code); } /** * @return int */ public function getErrorCode(): int { return $this->error_code; } /** * @return string */ public function getDescription(): string { return $this->description; } /** * @return string */ public function getErrorMessage(): string { return $this->error_message; } /** * @return VKApiError */ public function getError(): VKApiError { return $this->error; } } ================================================ FILE: src/VK/Exceptions/VKClientException.php ================================================ client = $client ?? new Client(); } /** * @return float */ public function getTimeout(): float { return $this->timeout; } public function setTimeout(float $timeout): self { $this->timeout = $timeout; return $this; } public function getHost(): string { return $this->host; } public function setHost(string $host): self { $this->host = rtrim($host, '/'); return $this; } /** * @param string $method * @param string $url * @param array $params * @param array $headers * @return mixed * @throws VKClientException * @throws VKOAuthException */ protected function request(string $method, string $url, array $params = [], array $headers = []): array { $params['timeout'] = $this->getTimeout(); try { $response = $this->client->request($method, $url, $params, $headers); } catch (GuzzleException $e) { throw new VKClientException($e); } return $this->checkOAuthResponse($response); } /** * Decodes the authorization response and checks its status code and whether it has an error. * * @param ResponseInterface $response * * @return mixed * * @throws VKClientException * @throws VKOAuthException */ protected function checkOAuthResponse(ResponseInterface $response): mixed { if ($response->getStatusCode() !== static::HTTP_STATUS_CODE_OK) { throw new VKClientException("Invalid http status: {$response->getStatusCode()}"); } $body = $response->getBody()->getContents(); $decode_body = $this->decodeBody($body); if (isset($decode_body[static::RESPONSE_KEY_ERROR])) { throw new VKOAuthException( "{$decode_body[static::RESPONSE_KEY_ERROR_DESCRIPTION]}. OAuth error {$decode_body[static::RESPONSE_KEY_ERROR]}" ); } return $decode_body; } /** * @param string $body * @return array */ protected function decodeBody(string $body): array { $decoded_body = json_decode($body, true); if (!is_array($decoded_body)) { $decoded_body = []; } return $decoded_body; } } ================================================ FILE: src/VK/OAuth/Group/DTO/AccessTokenParams.php ================================================ clientId = $clientId; $this->clientSecret = $clientSecret; $this->redirectUri = $redirectUri; $this->code = $code; } /** * @return int */ public function getClientId(): int { return $this->clientId; } /** * @return string */ public function getClientSecret(): string { return $this->clientSecret; } /** * @return string */ public function getRedirectUri(): string { return $this->redirectUri; } /** * @return string */ public function getCode(): string { return $this->code; } /** * @return array */ public function toArray(): array { return [ static::PARAM_CLIENT_ID => $this->clientId, static::PARAM_CLIENT_SECRET => $this->clientSecret, static::PARAM_REDIRECT_URI => $this->redirectUri, static::PARAM_CODE => $this->code, ]; } } ================================================ FILE: src/VK/OAuth/Group/DTO/AuthorizeUrlParams.php ================================================ responseType = $responseType; $this->clientId = $clientId; $this->redirectUri = $redirectUri; $this->display = $display; $this->state = $state; } /** * @return string */ public function getResponseType(): string { return $this->responseType; } /** * @return int */ public function getClientId(): int { return $this->clientId; } /** * @return string */ public function getRedirectUri(): string { return $this->redirectUri; } /** * @return string */ public function getDisplay(): string { return $this->display; } /** * @return string */ public function getState(): string { return $this->state; } /** * @return int[] */ public function getScopes(): array { return $this->scopes; } /** * @param int[] $scopes * @return $this * @see Scopes */ public function setScopes(array $scopes): self { $this->scopes = $scopes; return $this; } /** * @return int[] */ public function getGroupIds(): array { return $this->groupIds; } /** * @param int[] $groupIds * @return $this */ public function setGroupIds(array $groupIds): self { $this->groupIds = $groupIds; return $this; } /** * @return bool */ public function isRevoke(): bool { return $this->revoke; } /** * @param bool $revoke * @return $this */ public function setRevoke(bool $revoke = true): self { $this->revoke = $revoke; return $this; } /** * @param string $version * @return array */ public function toArray(string $version): array { $mask = 0; foreach ($this->getScopes() as $scope) { $mask |= $scope; } $params = [ static::PARAM_CLIENT_ID => $this->getClientId(), static::PARAM_REDIRECT_URI => $this->getRedirectUri(), static::PARAM_DISPLAY => $this->getDisplay(), static::PARAM_SCOPE => $mask, static::PARAM_STATE => $this->getState(), static::PARAM_RESPONSE_TYPE => $this->getResponseType(), static::PARAM_VERSION => $version, ]; if ($this->getGroupIds()) { $params[static::PARAM_GROUP_IDS] = implode(',', $this->getGroupIds()); } if ($this->isRevoke()) { $params[static::PARAM_REVOKE] = 1; } return $params; } } ================================================ FILE: src/VK/OAuth/Group/Display.php ================================================ version = self::VERSION; $this->host = static::HOST; } public function getVersion(): string { return $this->version; } public function setVersion(string $version): self { $this->version = $version; return $this; } /** * @param AuthorizeUrlParams $params * @return string */ public function getAuthorizeUrl(AuthorizeUrlParams $params): string { return $this->host . static::ENDPOINT_AUTHORIZE . '?' . http_build_query($params->toArray($this->version)); } /** * @param AccessTokenParams $params * @return array * @throws VKClientException * @throws VKOAuthException */ public function getAccessToken(AccessTokenParams $params): array { return $this->request('GET', $this->host . static::ENDPOINT_ACCESS_TOKEN, [ 'query' => $params->toArray(), 'timeout' => $this->timeout, ]); } } ================================================ FILE: src/VK/OAuth/Group/Scopes.php ================================================ client_id = $client_id; $this->redirect_uri = $redirect_uri; $this->state = $state; $code_challenge = hash('sha256', $verifier, true); $code_challenge = rtrim(strtr(base64_encode($code_challenge), '+/', '-_'), '='); $this->code_challenge = $code_challenge; } /** * @return string[] */ public function getScopes(): array { return $this->scopes; } /** * @param string[] $scopes * @return $this */ public function setScopes(array $scopes): self { $this->scopes = $scopes; return $this; } /** * @return string */ public function getPrompt(): string { return $this->prompt; } /** * @param string $prompt * @return $this */ public function setPrompt(string $prompt): self { $this->prompt = $prompt; return $this; } /** * @return string */ public function getProvider(): string { return $this->provider; } /** * @param string $provider * @return $this */ public function setProvider(string $provider): self { $this->provider = $provider; return $this; } /** * @return int */ public function getLangId(): int { return $this->lang_id; } /** * @param int $lang_id * @return $this */ public function setLangId(int $lang_id): self { $this->lang_id = $lang_id; return $this; } /** * @return string */ public function getScheme(): string { return $this->scheme; } /** * @param string $scheme * @return $this */ public function setScheme(string $scheme): self { $this->scheme = $scheme; return $this; } /** * @return string */ public function getResponseType(): string { return $this->response_type; } /** * @return int */ public function getClientId(): int { return $this->client_id; } /** * @return string */ public function getCodeChallenge(): string { return $this->code_challenge; } /** * @return string */ public function getCodeChallengeMethod(): string { return $this->code_challenge_method; } /** * @return string */ public function getRedirectUri(): string { return $this->redirect_uri; } /** * @return string */ public function getState(): string { return $this->state; } /** * @return array */ public function toArray(): array { return [ self::PARAM_RESPONSE_TYPE => $this->response_type, self::PARAM_CLIENT_ID => $this->client_id, self::PARAM_CODE_CHALLENGE => $this->code_challenge, self::PARAM_CODE_CHALLENGE_METHOD => $this->code_challenge_method, self::PARAM_REDIRECT_URI => $this->redirect_uri, self::PARAM_SCOPE => implode(' ', $this->scopes), self::PARAM_STATE => $this->state, self::PARAM_PROMPT => $this->prompt, self::PARAM_PROVIDER => $this->provider, self::PARAM_LANG_ID => $this->lang_id, self::PARAM_SCHEME => $this->scheme, ]; } } ================================================ FILE: src/VK/OAuth/User/DTO/IdTokenParams.php ================================================ client_id = $client_id; $this->id_token = $id_token; } /** * @return string */ public function getViewType(): string { return $this->view_type; } /** * @param string $view_type * @return $this */ public function setViewType(string $view_type): self { $this->view_type = $view_type; return $this; } /** * @return int */ public function getClientId(): int { return $this->client_id; } /** * @return string */ public function getIdToken(): string { return $this->id_token; } /** * @return array */ public function toArray(): array { $params = [ self::PARAM_CLIENT_ID => $this->client_id, self::PARAM_ID_TOKEN => $this->id_token, ]; if ($this->view_type != ViewType::VIEW_TYPE_RFC) { $params[self::PARAM_VIEW_TYPE] = $this->view_type; } return $params; } } ================================================ FILE: src/VK/OAuth/User/DTO/LogoutParams.php ================================================ client_id = $client_id; $this->access_token = $access_token; } /** * @param string $view_type * @return $this */ public function setViewType(string $view_type): self { $this->view_type = $view_type; return $this; } /** * @return int */ public function getClientId(): int { return $this->client_id; } /** * @return string */ public function getAccessToken(): string { return $this->access_token; } /** * @return string */ public function getViewType(): string { return $this->view_type; } /** * @return array */ public function toArray(): array { $params = [ self::PARAM_CLIENT_ID => $this->client_id, self::PARAM_ACCESS_TOKEN => $this->access_token, ]; if ($this->view_type != ViewType::VIEW_TYPE_RFC) { $params[self::PARAM_VIEW_TYPE] = $this->view_type; } return $params; } } ================================================ FILE: src/VK/OAuth/User/DTO/RefreshTokensParams.php ================================================ client_id = $client_id; $this->refresh_token = $refresh_token; $this->device_id = $device_id; } /** * @return string */ public function getScope(): string { return $this->scope; } /** * @param string $scope * @return $this */ public function setScope(string $scope): self { $this->scope = $scope; return $this; } /** * @return string */ public function getIp(): string { return $this->ip; } /** * @param string $ip * @return $this */ public function setIp(string $ip): self { $this->ip = $ip; return $this; } /** * @return string */ public function getViewType(): string { return $this->view_type; } /** * @param string $view_type * @return $this */ public function setViewType(string $view_type): self { $this->view_type = $view_type; return $this; } /** * @return int */ public function getClientId(): int { return $this->client_id; } /** * @return string */ public function getRefreshToken(): string { return $this->refresh_token; } /** * @return string */ public function getDeviceId(): string { return $this->device_id; } /** * @return array */ public function toArray(): array { $params = [ self::PARAM_GRANT_TYPE => self::GRANT_TYPE, self::PARAM_CLIENT_ID => $this->client_id, self::PARAM_REFRESH_TOKEN => $this->refresh_token, self::PARAM_DEVICE_ID => $this->device_id, ]; if ($this->scope) { $params[self::PARAM_SCOPE] = $this->scope; } if ($this->ip) { $params[self::PARAM_IP_ADDRESS] = $this->ip; } if ($this->view_type != ViewType::VIEW_TYPE_RFC) { $params[self::PARAM_VIEW_TYPE] = $this->view_type; } return $params; } } ================================================ FILE: src/VK/OAuth/User/DTO/Scopes.php ================================================ client_id = $client_id; $this->code_verifier = rtrim(strtr(base64_encode($code_verifier), '+/', '-_'), '='); $this->redirect_uri = $redirect_uri; $this->code = $code; $this->device_id = $device_id; } /** * @return string */ public function getServiceToken(): string { return $this->service_token; } /** * @param string $service_token * @return $this */ public function setServiceToken(string $service_token): self { $this->service_token = $service_token; return $this; } /** * @return string */ public function getIp(): string { return $this->ip; } /** * @param string $ip * @return $this */ public function setIp(string $ip): self { $this->ip = $ip; return $this; } /** * @return string */ public function getViewType(): string { return $this->view_type; } /** * @param string $view_type * @return $this */ public function setViewType(string $view_type): self { $this->view_type = $view_type; return $this; } /** * @return int */ public function getClientId(): int { return $this->client_id; } /** * @return string */ public function getCodeVerifier(): string { return $this->code_verifier; } /** * @return string */ public function getRedirectUri(): string { return $this->redirect_uri; } /** * @return string */ public function getCode(): string { return $this->code; } /** * @return string */ public function getDeviceId(): string { return $this->device_id; } /** * @return array */ public function toArray(): array { $params = [ self::PARAM_GRANT_TYPE => self::GRANT_TYPE, self::PARAM_CLIENT_ID => $this->client_id, self::PARAM_CODE_VERIFIER => $this->code_verifier, self::PARAM_REDIRECT_URI => $this->redirect_uri, self::PARAM_AUTHORIZATION_CODE => $this->code, self::PARAM_DEVICE_ID => $this->device_id, ]; if ($this->service_token) { $params[self::PARAM_SERVICE_TOKEN] = $this->service_token; } if ($this->ip) { $params[self::PARAM_IP_ADDRESS] = $this->ip; } if ($this->view_type != ViewType::VIEW_TYPE_RFC) { $params[self::PARAM_VIEW_TYPE] = $this->view_type; } return $params; } } ================================================ FILE: src/VK/OAuth/User/DTO/ViewType.php ================================================ host = self::HOST; } /** * @return string */ public function getHost(): string { return $this->host; } /** * @param string $host * @return $this */ public function setHost(string $host): self { $this->host = $host; return $this; } /** * Build authorization url, redirect browser to start authorization process. * As a success result "redirect_uri" will get "code", "device_id" & "state" params. * i.e.: GET https://your.site?code=vk2.a.4dvgLdQ5....dxtBxyw&device_id=uDDd....1VrpmCpsA&state=YYYRandomXXX * So compare received state with a value do you send to authorization url, it MUST be equal to continue authorization flow, * otherwise terminate it for security reason. * Use received "code" & "device_id" values to get access & refresh tokens. * * @param AuthorizeUrlParams $params * @return string */ public function getAuthorizeUrl(AuthorizeUrlParams $params): string { return $this->host . static::ENDPOINT_AUTHORIZE . '?' . http_build_query($params->toArray()); } /** * exchange authorization code for access, refresh & id tokens * * @param TokensParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function getTokens(TokensParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_TOKEN, [ 'form_params' => $params->toArray(), ]); } /** * refresh tokens * * @param RefreshTokensParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function refreshTokens(RefreshTokensParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_TOKEN, [ 'form_params' => $params->toArray(), ]); } /** * logout (invalidate tokens) * * @param LogoutParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function logout(LogoutParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_LOGOUT, [ 'form_params' => $params->toArray(), ]); } /** * revoke granted scopes * * @param LogoutParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function revoke(LogoutParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_REVOKE, [ 'form_params' => $params->toArray(), ]); } /** * get user info * Access token should have following scopes to get info: * vkid.personal_info - to get first & last name, avatar, sex, birthday, etc. * email - to get email * phone - to get phone * * @param LogoutParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function getUserInfo(LogoutParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_USER_INFO, [ 'form_params' => $params->toArray(), ]); } /** * get public (masked) user info * * @param IdTokenParams $params * @return mixed * @throws VKClientException * @throws VKOAuthException */ public function getUserPublicInfo(IdTokenParams $params) { return $this->request('POST', $this->host . static::ENDPOINT_PUBLIC_INFO, [ 'form_params' => $params->toArray(), ]); } } ================================================ FILE: src/VK/Transport/Client.php ================================================ setHandler(Utils::chooseHandler()); $stack->push(Middleware::mapRequest(function (RequestInterface $r) { return $r->withHeader('User-Agent', self::USER_AGENT . ' php/' . phpversion()); })); parent::__construct(array_merge( $config, ['handler' => $stack] )); } }