API ReferenceAnnouncementsCommunity Discussion
API ReferenceCommunity DiscussionAnnouncementsSubscribeLog In
Community Discussion

Community Discussion

Ask a Question
Back to All

Requested action is forbidden

I am trying to block a publisher and when executing the request I receive the error Requested action is forbidden

       $url = "https://backstage.taboola.com/backstage/api/1.0/$account_id/campaigns/$campaign_id/";
        $body = json_encode([
            "patch_operation" => "ADD",
            "publisher_targeting" => [
                "publishers"=> [$site]
            ]
        ]);

        $client = new GuzzleHttp();
        try {
            $response = $client->request('PATCH', $url, [
                'headers' => [
                    'authorization' => "Bearer $token",
                    'accept' => 'application/json',
                    'content-type' => 'application/json',
                ],
                'body' => $body,
            ]);

            $response_curl->status=1;
        }catch (\Exception $e) {
            $response = $e->getResponse();
        }