Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Gemini API

web-app

Hi,

I am looking at using the Gemini API. I want to add a issue to our gemini database when we recieve a email into a certain email box. I have got the email bit working using windows services but I want to be able to automatically create a issue. What parts of the API do I use??

Thanks

Marc Garraway

marc.garraway
· 1
marc.garraway
Replies (21)
helpful
0
not helpful

Hi Marc. Please refer to our API guide.


Bikram
· 1
Bikram
helpful
0
not helpful

Hi,

I have looked at the api guide and I have done everything it says and I am now getting a exception being thrown

"Root element is missing."

this my code

        string txtURL = details.url;
        string txtUserName = details.username;
        string txtPassword = details.password;

        ServiceManager serviceMrg = new ServiceManager(txtURL, txtUserName, txtPassword, "", false);

        UserEN user = serviceMrg.UsersService.WhoAmI();

       string languageXML = serviceMrg.AdminService.GetXmlLanguageFile("en-GB");

       GeminiConfigurationEN config = serviceMrg.AdminService.GetConfiguration();

        IssueEN _issue2 = serviceMrg.IssuesService.GetIssue(3524);

        int len = serviceMrg.ProjectsService.GetProjects().Length;

        IssueEN _issue = new IssueEN();

        _issue.ProjectID = 167;
        _issue.IssueSummary = "TestIssue";
        _issue.IssueLongDesc = "THIS IS A TEST";
        _issue.ReportedBy = user.UserID;

        IssueEN iss = serviceMrg.IssuesService.CreatePartialIssue(_issue);

marc.garraway
· 1
marc.garraway
helpful
0
not helpful

Which line causes the exception?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Hi,

Its the last line, when I make the call to the API, it returns a "xml root node error" or something along that line.

I have looked in the API documentation and filled in everything I need to, and when I searched for the error other people refered to a server config, but I have checked that and all "verbs" are allowed.

Any help??


Thanks

Marc


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

What Gemini version are you using?

Please make sure Project default values are set. Project Default Values can be set from- Project Administration > Default Values.

See sample application to demonstrate Gemini REST API setup and  invocation.

http://countersoft.com/downloads/v354/CounterSoftGeminiAPISamplesv354.zip


Bikram
· 1
Bikram
helpful
0
not helpful

Hi,

We are using the latest version 3.5.4

I have downloaded the application and using my login details.

when I try and use the applciaiton it thrown an exception and I am unable to create an issue.


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

Try setting the IssueTypeId? The API recommends it (I know it says it's not mandatory, but worth a shot?)


alitheg
· 1
alitheg
helpful
0
not helpful

I have updated the code and added

_issue.IssueType = 1;

this is no "issueTypeID" when you use intellisense, this is the nearest thing to it.

but again it is still not working


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

Are there any errors in Gemini's error log?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Yeah sorry that's the one I meant. Forgot it wasn't named with ID.

I've not has this error, just wondered if I could help. I know Bikram suggested it already, but are your project default values set?

Also what happens if you don't assign the result of CreatePartialIssue to a new IssueEN, and just let it drop. Is it the assignment to the new entity, or the call to the service manager that is causing the error?

Try specifying a complete set of values (just to experiment) and use CreateIssue instead.


alitheg
· 1
alitheg
helpful
0
not helpful

where do I find that, I have looked in the system at

SLAWEBADDRESSHERE/admin/ErrorLog.aspx

and there is nothing in it


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

this is the project defaults

http://twitpic.com/gybv2


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

I'm probably quite wrong, but doesn't it need a component selected?


alitheg
· 1
alitheg
helpful
0
not helpful

I had it working, I have now come back to it and I get an error

CounterSoft.Gemini.Commons.Rest.GeminiRestException: Exception has been thrown by the target of an invocation. at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url,Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r) at CounterSoft.Gemini.WebServices.IssuesService.CreatePartialIssue(IssueEN issue) at GeminiExchange.Program.Main(String[] args) in C:\Users\mxg\Documents\Visual Studio 2008\Projects\GeminiExchange\GeminiExchange\Program.cs:line 34

This is my source code

    public static void Main(string[] args)
    {
        try
        {

string txtURL = details.url; string txtUserName = details.username; string txtPassword = details.password;

            ServiceManager serviceMrg = new ServiceManager(txtURL, txtUserName, txtPassword, "", false);

            UserEN user = serviceMrg.UsersService.WhoAmI();

            IssueEN _issue = new IssueEN();

            _issue.ProjectID = 168;
            _issue.IssueSummary = "TestIssue234324";
            _issue.IssueLongDesc = "THIS IS A TEST243243252562652345";
            _issue.ReportedBy = user.UserID;
            _issue.IssueType = 1; 

            IssueEN iss = serviceMrg.IssuesService.CreatePartialIssue(_issue);

            Console.WriteLine("SUCCESS");
            Console.ReadLine();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
            Console.ReadLine();
        }
    }

marc.garraway
· 1
marc.garraway
helpful
0
not helpful

Do you have defualt values set?
Also, try and inspect the expception via the debugger (inner exception) it might tell you more.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

these are my defaults

http://twitpic.com/ixv5i/full

I am getting a new error


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

when i ask for a inner exception I get

NullReferenceException was unhandled

Object reference not set to an instance of an object.


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

Is it possible for you to send us your database and code?
If so please email it to support at countersoft dot com


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

sent countersoft support a email


marc.garraway
· 1
marc.garraway
helpful
0
not helpful

The issue type used was not a valid id.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

thanks for the email, solved it, it was an incorrect ID


marc.garraway
· 1
marc.garraway