MYOBCommunity
Partner Zone
|
|
Partner Zone

The supplied Uri is not valid for the current service

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
10 REPLIES 10
Highlighted
Contributing Cover User options
7 Posts
Contributing Cover User
options
Contributing Cover User

7Posts

0Kudos

0Solutions

Re: The supplied Uri is not valid for the current service

Here you go

 

MYOB5.png

Former Staff KeranM
299 Posts
Former Staff
Australia
KeranM
Former Staff

299Posts

94Kudos

56Solutions

Re: The supplied Uri is not valid for the current service

Hey there

 

Lets move this over to developers@myob.com

Can you capture both the request and response headers for the requests so we can better see what's going on & provide those in an email to the above address. 

 

Thanks

Keran McKenzie
Futurist in residence @MYOB

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/

Twitter: @myobapi | @keranm
Contributing Cover User options
7 Posts
Contributing Cover User
options
Contributing Cover User

7Posts

0Kudos

0Solutions

Re: The supplied Uri is not valid for the current service

Hi there,

 

I can guarantee that I'm using AccountRight SDK version 2. The figure below can show you my debugging process in which I has stepped into MYOB's source code to see how does it build the header for the WebRequest instance. However I still get an exception.

 

Any idea?MYOB4.png

Former Staff KeranM
299 Posts
Former Staff
Australia
KeranM
Former Staff

299Posts

94Kudos

56Solutions

Re: The supplied Uri is not valid for the current service

Hey there

 

There is nothing to download, it's all there in the package you have

 

Simply make sure the header contains x-myobapi-version: v2

As per the documentation on the developer site http://developer.myob.com/api/accountright/api-overview/headers/ 

 

Version 1 was something we released early on in the process, and we very quickly moved to v2 back in 2012. We've not versioned since then.

 

V2 is compatible with 2014.1 

However to find out exactly what endpoints, features and such like are compatible you can hit the INFO endpoint (http://developer.myob.com/api/accountright/v2/info/) and this will tell you all sorts of information about the API, the endpoints and various versions required for specific endpoints.

 

Hope that helps

K.

Keran McKenzie
Futurist in residence @MYOB

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/

Twitter: @myobapi | @keranm
Contributing Cover User options
7 Posts
Contributing Cover User
options
Contributing Cover User

7Posts

0Kudos

0Solutions

Re: The supplied Uri is not valid for the current service

Hi there,

 

From what you mentioned I guess you're trying to say: I should use MYOB Accounting Right hosting service version 2 instead of version 1.

 

If it's the case from where I can download that version. and whether or not that version is backward compatible with MYOB 2014.1

 

The below figure is showing you: What I have got in my environment atm

 

MYOB3.png

Former Staff KeranM
299 Posts
Former Staff
Australia
KeranM
Former Staff

299Posts

94Kudos

56Solutions

Re: The supplied Uri is not valid for the current service

Yeah doing in the browser like that forces the API to v1 and you should really be using v2. V1 is deprecated and doesn't have the depth of detail you need.

 

I'd recommend using AdvancedRestClient (you can find the link on our tools page http://developer.myob.com/resources/tools/) because this allows you to set the headers correctly

 

You can see here that ARC gives more controll

 

Screen Shot 2015-03-13 at 11.13.51 am.png

 

The other thing is you'll need to tweak your query, you need to tell oData that you are looking for a GUID

 

https://api.myob.com/accountright/20fd0efd-1d28-4f81-ad71-530f6b39a631/Contact/Supplier?$filter=UID eq guid'f13bdde6-2892-4387-89c5-e0cdf4c59520'

 Thats my example one, you'd need to tweak the URL and GUIDs to match local host for your files

 

Hope that helps

 

Keran McKenzie
Futurist in residence @MYOB

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/

Twitter: @myobapi | @keranm
Contributing Cover User options
7 Posts
Contributing Cover User
options
Contributing Cover User

7Posts

0Kudos

0Solutions

Re: The supplied Uri is not valid for the current service

Any idea

 

MYOB2.png

Former Staff KeranM
299 Posts
Former Staff
Australia
KeranM
Former Staff

299Posts

94Kudos

56Solutions

Re: The supplied Uri is not valid for the current service

Hi there

 

Right I can see what you are trying to do there. When you call

 

https://api.myob.com/accountright/{cf-guid}/Contact/Supplier/{guid}

 It'll return 404 if it can't find that supplier - that's a valid response becuase there is nothing to be found.

 

However what you probably should be doing is searching the Suppliers so you could use a filter. Lets say the supplier GUID is "8654a102-4859-451f-834b-0ddb9bbf2edc" you could do this

 

https://api.myob.com/accountright/{cf-guid}/Contact/Supplier/?$filter=UID eq guid'8654a102-4859-451f-834b-0ddb9bbf2edc'

This won't respond in 404, what it will do is if that supplier exists, it'll respond with that supplier, if not, it'll respond with an empty dataset.

 

Hope that helps

 

 

 

 

Keran McKenzie
Futurist in residence @MYOB

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/

Twitter: @myobapi | @keranm
Contributing Cover User options
7 Posts
Contributing Cover User
options
Contributing Cover User

7Posts

0Kudos

0Solutions

Re: The supplied Uri is not valid for the current service

Hi there,

 

Many thanks for your reply.

 

What I'm trying to do is: before importing any new supplier I'll make a call supplierService.Get API to check whether or not the supplier with the given UID exists. If it does, I'll modify the supplier if it doesn't I'll create a new supplier and then call supplierService.Import method. Unfortunately the exception occurs on both methods.

 

Kindly have a look at attached image below

 

MYOB.png

Experienced Partner GeorgeChijarira
30 Posts
Experienced Partner
Australia
GeorgeChijarira
Experienced Partner

30Posts

4Kudos

6Solutions

Re: The supplied Uri is not valid for the current service

Hi there!,

404 generally means the item you are looking for is no longer there - meaning you are missing or not providing an ID or similar.

Could you show me the actual call that you are making that results in the above output, I may be able to see the issue from there.

Cheers
Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post