-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSC.SubscriptionItem, Payload is either malformed or incomplete. (0x5CE10192 : Specifying subscription attachments not allowed.) #1430
Comments
From the REST API documentation:
|
the parameters are true and not false in my script. So when I manually create the subscription or when I use a request it works. So I don't understand why it doesn't work |
What happens if you set image to True, pdf to False, and remove the pdf specific options? Try the simplest case first. |
?? Help me :-) |
My minimally reproducible example works. edit: Also attaching image. Still works. # /// script
# requires-python = ">=3.10
# dependencies = [
# "tableauserverclient>=0.32.0",
# "python-dotenv"
# ]
# ///
import os
from dotenv import load_dotenv
import tableauserverclient as TSC
load_dotenv()
auth = TSC.PersonalAccessTokenAuth(
token_name=os.environ["TABLEAU_TOKEN_NAME"],
personal_access_token=os.environ["TABLEAU_PAT"],
site_id=os.environ["TABLEAU_SITE"]
)
server = TSC.Server(os.environ["SERVER_ADDRESS"], use_server_version=True)
with server.auth.sign_in(auth):
workbook = server.workbooks.filter(name="Team Metrics")[0]
target = TSC.Target(workbook.id, "workbook")
# Pick a random schedule for testing purposes
sched = next(s for s in TSC.Pager(server.schedules) if s.schedule_type == TSC.ScheduleItem.Type.Subscription)
sub = TSC.SubscriptionItem("message", schedule_id=sched.id, user_id=server.user_id, target=target)
sub.attach_image = True
sub.attach_pdf = True
sub.page_orientation = TSC.PDFRequestOptions.Orientation.Portrait
sub.page_size_option = TSC.PDFRequestOptions.PageType.A4
sub.send_if_view_empty = True
sub = server.subscriptions.create(sub) |
@gdrau what API version are you using in your script? This error message will also be returned if you are specifying an API version below 3.5, when the feature was implemented. |
I created a sample for subscriptions and verified that it succeeds with the current server version, and fails using 2.4. #1487 |
Hello, I'm trying to create a subscription for a user on a view. I put this piece of code,
schedule_id = '60c392fc-d902-44b0-92cf-cfa3b512630f'
user_id = df[0].values[i]
# Create the new SubscriptionItem object with variables from above.
new_sub = TSC.SubscriptionItem('EssaiGD', schedule_id, user_id, target)
I launch it and when I have the error it gives me 0x5CE10192 : Specifying subscription attachments not allowed.
THanks
Version :
Product version: 2024.2.0
REST API version: 3.23
Build number: 20242.24.0711.1807
Python 3.10.6
The text was updated successfully, but these errors were encountered: