Sending items to a project

Hey Guys,

I’m trying to send items to a project (not a workspace) but i keep getting a response noting that i’m not authorized. I’m trying to use the same script as i have used for the workspaces as shown below. I also created a new token which should have the propper rights. Since the exact same script works for workspaces, it begs to question if there is a difference between the logic needed to write to a project in comparisson to a workspace?

server = "https://app.speckle.systems/"
client = SpeckleClient(server, use_ssl=True)
client.authenticate_with_token(token)

responses=[]
for key in obj_dict.keys():
    detached_base                       = Base()
    detached_base.applicationId         = obj_dict[key]["applicationId"]
    detached_base.displayValue          = obj_dict[key]["displayValue"]

    transport = ServerTransport(client=client, stream_id=project_id)
    hash = operations.send(base=detached_base,transports=[transport])
    responses.append(client.version.create(CreateVersionInput(objectId=hash,modelId=version_id,projectId=project_id,message=message)))

print(responses)

Hey @DonnyRH,

Can you double check and make sure that:

  1. the Access Token has the correct Scopes (i.e. “streams:write”)
  2. you have full access to the project (i.e. is not created by someone else and set to private)

Also it will be helpful to share with us a screenshot with the error.

Thanks

Hey Nikos,

I allready found the issue. I accidently mixed up the projectId with the modelId. My bad!

1 Like