Forum Discussion

OttoWolf's avatar
4 years ago

Using SDK to POST without using credentials

Hi Guys,

 

Noob here using the MYOB Api to integrate with a desktop application in .NET. I am using the SDK with the cloud and everything works when it comes to authentication and can get company file ok, yet i cannot find a method to post an invoice without passing the credentials into it. I read on the below post that the credentials are optional if you link the CF to the my.myob.com userID which i did but the credential param in the Insert method is mandatory and not optional.

 

https://community.myob.com/t5/MYOB-API-questions-and-answers/AccountRight-API-must-receive-credentials-for-specific-company/td-p/493812

 

The sample you guys provide in the docs to do this is the following.

 

// Push new invoice details through to cf using insert method from the invoiceItemSvc
invoiceItemSvc.Insert(myCompanyFile, ItemInvoice, myCredentials, onSaveComplete, OnError);

I couldn't find an overload without the credentials.

 

Can you please provide me with an example or sample on how to post an new invoice using SDK without the credentials and if it's not possible, then just confirm it for me.

 

Thanks in advance.

 

 

  • Hey Otto,

     

    I use VB.net so I pass 'nothing' as credentials and it works , I believe the c# equivalent is null 

     

    Happy programming

     

    • OttoWolf's avatar
      OttoWolf

      Thanks for the reply J 👍 Unfortunately it did not work for my case and support confirmed that i do need to pass credentials.

       

      Cheers