question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ asked ·

API application "{0}" invalid.

Hi,

 

My sandbox credentials work fine. When I try to use this code with my production credentials, I get this error:

 

API application xx is invalid. Here is my code:

 

        public override bool AuthenticateToWebService()

        {

            try

            {

                if (String.IsNullOrEmpty(sessionID))

                {

                    apiContext = GetApiContext();

                    GetSessionIDCall gsc = new GetSessionIDCall(apiContext);

                    sessionID = gsc.GetSessionID(apiContext.RuName);

                    SdkUtility.LaunchSignInPage(apiContext, sessionID);

                    return false;

                }

                else

                {

                    FetchTokenCall ftc = new FetchTokenCall(apiContext);

                    apiContext.ApiCredential.eBayToken = ftc.FetchToken(sessionID);

                    Page.Session["QBUrl"] = QBUrl;

                    Page.Session["UserName"] = UserName;

                    Page.Session["Password"] = Password;

                    Page.Session["ECommerceSystem"] = ECommerceSystem;

                    Page.Session["LoggedIn"] = true;

                    //let them auth at the config page. I have no value here.

                    return true;

                }

            }

            catch (Exception ex)

            {

                logProvider.WriteToLog(new ErrorMessage(JMA.Plugin.Accounting.QuickBooks.MessageSeverity.Error, "CCC", "eBay log failed: " + ex.ToString(), UserName));

                return false;

            }

        }

 

To use my app in production, which has less than 5,000 calls per day, do I need to go through a review process? I verified that my credentials are correct.

getsessionid
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ answered ·

Hi,

   I also have the same problem, but now I have found solved the problem.

   The reason of the problem is that your apiContext have some errors, then you can't call all the api method of eBay,the right apicontext of api call like that:

 

Public Shared Function GetApiContext(ByVal token As String, ByVal siteID As String) As ApiContext

        Dim apiContext As New ApiContext

        apiContext.SoapApiServerUrl = TopConfig.ApiServerUrl

        apiContext.ApiCredential.eBayToken = token

        If (String.IsNullOrEmpty(siteID)) Then 

            apiContext.Site = SiteCodeType.US

        Else

            Select Case siteID

                Case 0 

                    apiContext.Site = SiteCodeType.US

                Case 1 'Canada

                    apiContext.Site = SiteCodeType.Canada

                Case 2 'UK

                    apiContext.Site = SiteCodeType.UK

                Case 3 'Australia

                    apiContext.Site = SiteCodeType.Australia

                Case 4 'Austria

                    apiContext.Site = SiteCodeType.Austria

                Case 5 'Belgium_French

                    apiContext.Site = SiteCodeType.Belgium_French

                Case 6

                    apiContext.Site = SiteCodeType.France

                Case 7

                    apiContext.Site = SiteCodeType.Germany

                Case 8

                    apiContext.Site = SiteCodeType.Italy

                Case 9

                    apiContext.Site = SiteCodeType.Belgium_Dutch

                Case 10

                    apiContext.Site = SiteCodeType.Netherlands

                Case 11

                    apiContext.Site = SiteCodeType.Spain

                Case 12

                    apiContext.Site = SiteCodeType.Switzerland

                Case 13

                    apiContext.Site = SiteCodeType.Taiwan

                Case 14

                    apiContext.Site = SiteCodeType.eBayMotors

                Case 15

                    apiContext.Site = SiteCodeType.HongKong

                Case 16

                    apiContext.Site = SiteCodeType.Singapore

                Case 17

                    apiContext.Site = SiteCodeType.India

                Case 18

                    apiContext.Site = SiteCodeType.China

                Case 19

                    apiContext.Site = SiteCodeType.Ireland

                Case 20

                    apiContext.Site = SiteCodeType.Malaysia

                Case 21

                    apiContext.Site = SiteCodeType.Philippines

                Case 22

                    apiContext.Site = SiteCodeType.Poland

                Case 23

                    apiContext.Site = SiteCodeType.Poland

                Case 24

                    apiContext.Site = SiteCodeType.CustomCode

                Case 25

                    apiContext.Site = SiteCodeType.CanadaFrench

            End Select

        End If

        Return apiContext

    End Function

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vijayta.developersupport avatar image
0 Likes"
vijayta.developersupport answered ·

Hi

 

Can you check if you are using endpoint for Production ?

Here is the KB where you can have a quick look at the endpoints : https://ebaydts.com/eBayKBDetails?KBid=429

 

No you do not need an app check if the calls are less than 5000.

Just FYI, here is the call limit link to determine if you need an app check  :https://go.developer.ebay.com/developers/ebay/ebay-api-call-limits

 

Thanks

 

 

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.