getRouteParam('id'); $link = $request->getParsedBody()->link ?? null; if (!$id) { throw new BadRequest(); } if (!$link) { throw new BadRequest("No `link`."); } if (!$this->acl->checkScope(Campaign::ENTITY_TYPE, Table::ACTION_READ)) { throw new Forbidden(); } $attachmentId = $this->service->generate($id, $link); return ResponseComposer::json(['id' => $attachmentId]); } }