C# SDK 401 when Operations.Send or "No Speckle accounts found." when Helpers.Send

  • Objective: I’m experimenting with Speckle, sending data, creating branches and so on.
  • Issue: I’m trying to push data into a stream. I did it in two ways:
  1. Using Operations.Send
  2. Using Helpers.Send.

Using Operations.Send I get the following error: “Response status code does not indicate success: 401 (Unauthorized).”

On Helpers.Send I get the following error ‘No Speckle accounts found. Visit the Speckle web app to create one’.

In both cases I created a Personal Access Token to do the operations. On Example I’ll share my code

  • Example:

The example is pretty basic… Something that I don’t understand is that I was able to pull data and also I was able to create a new branch. The Personal Access Token was configures using all scopes (just in case)

using Speckle.Core.Models;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Transports;

var @base = new Base();
@base[ "name" ] = "Southwood Park";

var account = new Account
{
    token = "<MY_TOKEN>",
    serverInfo = new ServerInfo
    {
        url = "https://app.speckle.systems"
    }
};

var userInfo = await account.Validate();

Console.WriteLine(userInfo.email + "-" + userInfo.name);

var transport = new ServerTransport(account, "f6697c9f41");
// var commitId = await Helpers.Send("f6697c9f41", @base, "This is an object", account: account);
var objectId = await Operations.Send(
  @base,
  new List<ITransport> { transport });

Hey, @julio.sarachaga, My apologies for the delay over the weekend. Welcome to Speckle.

Sadly, I have been unable to reproduce your error.

var objectId = await Helpers.Send(projectId, @base, account: account);
[01:57:16 DBG] Starting execution of http request to https://app.speckle.systems/
[01:57:16 INF] Execution of http request to https://app.speckle.systems//authn/login succeeded with OK after 0.2616244 seconds and 0 retries
[01:57:16 INF] Successfully pinged https://app.speckle.systems/
[01:57:16 DBG] Starting execution of graphql request to get StreamData
[01:57:16 DBG] Starting execution of http request to https://app.speckle.systems/graphql
[01:57:17 INF] Execution of http request to https://app.speckle.systems//graphql succeeded with OK after 0.2732284 seconds and 0 retries
[01:57:17 INF] Execution of graphql request to get StreamData succeeded after 0.2739995 seconds
[01:57:17 INF] Initializing a new Remote Transport for https://app.speckle.systems
[01:57:17 INF] Starting send operation

Can you double-check that the project stream id is correct and that your token is also correctly set?

Hi @jonathon

I managed to make it work a few days after I posted and it was the streamId indeed.

Best,
Julio

3 Likes

Hola Julio! :wave:
Que bien verte aqui :wink:

1 Like