0

Overview: I am new to Assembla and I am having some trouble with authentication in C#.

I am trying to externally create tickets in assembla (Tickets POST), but I am having a hard time grabbing the access token. I think I need to use Web services or 3-step authentication flow, but is there any other way to get the token without any user input? I am trying to automate the ticket-creating process.

It is not much, but here is what I currently have (it returns all the tickets on that page):

var myRequest = (HttpWebRequest)WebRequest.Create("https://api.assembla.com/spaces/spaceName/tickets/");
myRequest.Method = "GET";
myRequest.Headers.Add("X-Api-Key", myKey);
myRequest.Headers.Add("X-Api-Secret", mySecret);
Ali
  • 558
  • 7
  • 28

1 Answers1

0

It wouldn't be possible to get the token from user without any action from their side. They would either need to allow your application to log in to Assembla by clicking on an Allow button after you present them a Web view (PIN code workflow) or you will need to redirect them to Assembla if you have a Web app (which looks like is not the case).

From the other side, if you have a single user that is going to be used for creating tickets, you could use X-Api-Key/X-Api-Secret workflow.

In order to create a ticket using this workflow, you might want to adapt your existing snippet by changing request method from GET to POST and then to provide the parameters needed to create the ticket.

SpeedyWizard
  • 568
  • 6
  • 13