- 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:
- Using Operations.Send
- 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 });