Method Community

 

API error message "There was an error in MethodAPIinsertV2"

Last post 12-04-2018 9:40 AM by Laks_Method. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 10-24-2018 4:32 PM

    API error message "There was an error in MethodAPIinsertV2"

    I'm getting the message: 

    There was an error in MethodAPIinsertV2

    This message is not much to go on.  Can you guys shed some light?  Account is "mchtechmsp"

  • 10-25-2018 8:09 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    Hello scarson,

    Can you give us more information as to which Table is throwing this error and what columns are you trying to Insert? It will help us if we can have a look at the request.

    Laks Sahayaprasath
    Product Manager
    Method CRM
  • 10-25-2018 10:53 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    The issue is with the purchaseorderline table. I am trying to insert values for Item, PurchaseOrderRecordID, Rate, and Quantity.

    Before trying to insert to the purchaseorderline table I have succesfully inserted a Purchase Order to the purchaseorder table.


    Here are the parameters for the failing API call.


    parameters = {
        'strCompanyAccount': companyAccount,
        'strLogin': username,
        'strPassword': password,
        'strSessionID': '',
        'strTable': 'purchaseorderline',
        'arrInsertFieldsArray': arrNames,
        'arrInsertValueArray': arrValues
    }


  • 10-25-2018 11:00 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    Hi there,

    This endpoint is a soap webservice. Are you using node or python? Are you calling it as just a http post or are you using any soap library?

    Regards,

    Hossein

  • 10-25-2018 11:23 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    yes, I am using the zeep SOAP client for python.

    I have successfully inserted purchase orders to the purchaseorder table.

    But I get this error when I try to insert purchase order line items to the purchaseorderline table for the previously inserted purchase order.

  • 10-25-2018 2:03 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    Are you including the auto generated ID of the Order? Can you please share your field names and values?

     

  • 10-25-2018 8:09 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    I beleive so.

    Here are example contents of the arrays. recordID is the value passed back from athe API after adding the Purchase Order.

    arrNames = ['Item', 'PurchaseOrderRecordID', 'Rate', 'Quantity']
    arrValues = ['100381', recordID, 12.23, 22.00]

  • 10-26-2018 12:27 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    I've tried something else and I am now getting this error.

    <MethodAPI response = "Not all required fields are present. Required field PurchaseOrderRef is not passed for the table purchaseorderline" ></MethodAPI>


    Looking through the tables I can't find a field PurchaseOrderRef for the table purchaseorderline. I've also tried passing this value anyways, but I just keep getting that same error.

  • 10-26-2018 12:43 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    Its looking for the RecordID(integer) of the purchase order that this line belongs to.  

    A good idea when using the API is to review the tables you are trying to insert into in Method.  The table UI in Method will show you the required fields, what table they come from if relelvant, and the type.

    Victoria Cameron
    vcameron@cloudconsutlancyllc.com
    www.cloudconsultancyllc.com
    650/209-0345

    What is Method?


  • 10-26-2018 12:56 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    That seems to be part of the issue. "PurchaseOrderRef" is not in the table UI for the purchaseorderline table.

  • 10-29-2018 10:06 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    PurchaseOrderRecordID is the field necessary for inserting a PurchaseOrderLine. Looks like your PurchaseOrderRecordID field is not getting inserted to PurchaseOrderLine. Maybe something to do with the way you are trying to insert variables? I see PurchaseOrderRecordID is the only field that has a variable in the above request

    Laks Sahayaprasath
    Product Manager
    Method CRM
  • 12-03-2018 10:19 PM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    I've tried hard coding a previous PurchaseOrderRecordID but the same issue still occurs.

    <MethodAPI response = "Not all required fields are present. Required field PurchaseOrderRef is not passed for the table purchaseorderline" ></MethodAPI>

  • 12-04-2018 9:40 AM In reply to

    Re: API error message "There was an error in MethodAPIinsertV2"

    Hello Scarson,

    I will reach out to you via email shortly in order to figure this out and get it working.

    Laks Sahayaprasath
    Product Manager
    Method CRM
Page 1 of 1 (13 items)