MYOB .NET SDK - Invoice creation - c#

I'm not sure if anyone will be able to help me or not but I am hoping there is someone familiar with the .NET SDK for MYOB.
The service classes accessible in the SDK provide the core HTTP
operations available for each consumable endpoint. These include the
following operators:
Get/GetRange – HTTP GET Insert – HTTP POST Update – HTTP PUT Delete –
HTTP DELETE
https://developer.myob.com/api/myob-business-api/arlive-sdk/dotnet_sdk/sdk-services/
The InvoiceService is accessed via
MYOB.AccountRight.SDK.Services.Sale.InvoiceService.
I have instantiated an InvoiceService object:
var invService = new InvoiceService(configuration);
However the InvoiceService class does not have an "Insert" function.
The API endpoint documentation suggests a "POST" is possible though: https://developer.myob.com/api/myob-business-api/v2/sale/invoice/invoice_service/
Am I using the wrong class? I unfortunately can't find any SDK documentation.

Try to use MYOB.AccountRight.SDK.Services.Sale.ItemInvoiceService instead of MYOB.AccountRight.SDK.Services.Sale.InvoiceService.

Related

SCIM and web api 2

I am trying to implement SCIM with Web Api 2 (c#) and I've found the nuget package and some documentation from Microsoft and their sample code.
My understanding from the SCIM documentation is that they just need an API with the specified user/Group methods and schemas, but in the sample code they have used a monitor and provider.
public Startup()
{
IMonitor monitor = new DefaultMonitor();
IProvider provider = new SampleProvider();
this.starter = new WebApplicationStarter(provider, monitor);
}
Their code doesn't compile even after following the instructions and getting nuget packages most probably because of the old resources on the packages that they have used, but also I don't see what is the nececity of using the package other than adding some interfaces for my controllers.
I've also found this:
SCIM (System for Cross-domain Identity Management) library for C#
But it is also a shame that the blog post that they are pointing to from MS is gone :.
So what I am asking is:
- Am I going the correct direction? Should I use the nuget?
And if yes, anything special on Web api?
Any suggestion is also very appreciated.

c# web api as jira webhook url

I have been tasked to implement a JIRA SMS notification(using Twilio) similar to its in-built email notification. I know this can be easily done using Zapier and Twilio.
But i am told to look for a workaround with out using Zapier.
The only option i think of now is to create a WebApi project that calls Twilio to send the SMS, host the WebApi project on a server and pass this URL as a WEBHOOK in JIRA.
For this i have created a C# class library which calls Twilio.
class
and after that i have added a new WebApi project for this solution and added the above class project reference.
and i have added a new controller:
controller
i am just calling the send method from the constructor with out any parameters which i think will do the job just from hardcoded number to a given number(in the controller.
but what i need is to pass in messageBody and recipientPhoneNumber from the JIRA webhook to this controller. Not sure how to do this.
As i am very new to WebApi's could some one please help me with the code. much appreciated.
Twilio Dev Evangelist here...
Mind dropping me a note at corey#twilio.com? I agree with the previous responses - this site may not be the best forum to support what you're looking for here, but I would be more than happy to directly help you out here.
but what i need is to pass in messageBody and recipientPhoneNumber from the JIRA >webhook to this controller. Not sure how to do this.
The way webhooks work is a little bit different than your assumption above. You cannot pass anything to JIRA webhook. JIRA POSTs data to the webhook (your API URL). Once you receive the data in your API controller action, you can construct a message body and recipient phone number (from e.g. user object passed in by JIRA; if that object doesn't have any phone number attribute, you might have to use a custom field).
As i am very new to WebApi's could some one please help me with the code. much appreciated.
No problem. I guess you have done the Twilio part alright already. Please visit MS docs to know more about Web API. You have to add a controller method so that it can be called by JIRA. So your final URL becomes this. You can then put this URL in JIRA as webhook. Replace hostname mycompany.com by your server hostname and change other url segments based on your situation.

How to call Microsoft Graph Beta API from C#

I tried to get the content of the user's profile picture and I found out that I had to call the Beta version because the current version gives the following error message:
"code": "GetUserPhoto",
"message": "The operation is not supported."
So, I tried to switch to Beta, and here is the code that I wrote in C# to do it, but it doesn't work:
Microsoft.Graph 1.6.2
List<QueryOption> options = new List<QueryOption>
{
new QueryOption("$api-version", "beta")
};
var pictureStream = await graphClient.Me.Photo.Content.Request(options).GetAsync();
I got the same error message.
I tried the same request in the Graph Explorer. The 1.0 doesn't work, but Beta works.
The api-version query parameter is used by the Azure AD Graph API. This is a different API than Microsoft Graph. There is a lot of functional overlap (Azure AD Graph is slowly being migrated over to Microsoft Graph) but they use entirely different entities and calling conventions.
In order to call the /beta endpoint using the Microsoft Graph .NET Client Library, you need to change the BaseUrl of the client:
graphClient.BaseUrl = "https://graph.microsoft.com/beta";
var pictureStream = await graphClient.Me.Photo.Content.Request().GetAsync();
Some important notes about the /beta endpoint:
It isn't supported and isn't suitable for production. So don't do that. Or at least don't tell anyone and don't call Support if it stops working. ;-)
The .NET Client uses objects constructed off the production metadata. This means that any entities, actions or properties that were added in /beta don't exist in the models shipped with the SDK.
The .NET Client will ignore any values returned by Microsoft Graph that it doesn't expect to see. So if an endpoint returns a property that wasn't included in the production metadata (see #2), it will simply be ignored.
So long as you're only using a /beta to gain functionality but still expecting /v1.0 results, it should work okay. Photos for example only look at Exchange in v1.0 but look in both Exchange and Active Directory but still return the same result. In theory this means you should be able to swap /beta for /v1.0 without a problem.
I think you are still calling V1 endpoint. In fact, the Beta endpoint is not currently supported in the Microsoft Graph .NET Client Library. More info here.
There is an official beta client for Graph API now:
https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet

Using Twilio RestClient 5.x on a website's backend

In the previous version (4.x), we were able to initilize a TwilioRestClient instance per request. In that way, we could generate clients to use for accounts and subaccounts.
Is it possible to do the same with the newest version (5.x)?
Twilio Dev Evangelist here.
With the new version of the SDK for C#, there is no need to instantiate the RestClient more than once. You would initialize it by making a call to a static TwilioClient.Init method, passing in your account SID and auth token.
You can alternatively create your own REST client that derives from ITwilioRestClient, but that would totally depend on your use case.
Check out our migration docs here. It provides details on this and other changes for migration scenarios.

C# Amazon Product Advertising API

As of August 15, Amazon made it compulsory to sign all requests made to their Product Advertising API. I thought I had got everything working just fine but when the 15th finally came around, my web application stopped working and pretty much ever since I have been trying to find out how to sign the SOAP requests.
Amazon has an outdated sample code for signing requests that doesn't appear to work here
Basically, I need to know how to add a signature to the my requests using the most current C# SOAP API and .NET 3.5.
I hope I have given enough details, if I haven't please feel free to ask me to elaborate.
Thank You
The_Lorax
UPDATE:
I am using MVC and need to know how to add the Signature to the the ItemLookup or AWSECommerceService object. Is there an attribute that contains the signature value? How does it get attached to the request?
On this page, they say that I must include the Signature and TimeStamp parameters but the intellisense does now show any such attributes.
Check out http://flyingpies.wordpress.com/2009/08/01/17/. It has a walkthrough and a sample visual studio solution using C#, SOAP, WCF on .NET 3.5.
This library automatic sign the requests (Install-Package Nager.AmazonProductAdvertising)
https://www.nuget.org/packages/Nager.AmazonProductAdvertising/
Example:
var authentication = new AmazonAuthentication("accesskey", "secretkey");
var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.US);
var result = await client.SearchItemsAsync("canon eos");

Categories

Resources