Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem trying to create blank order #6

Open
swyse5 opened this issue Jul 13, 2015 · 2 comments
Open

Problem trying to create blank order #6

swyse5 opened this issue Jul 13, 2015 · 2 comments

Comments

@swyse5
Copy link

swyse5 commented Jul 13, 2015

When making the following API call:

POST https://fm260.infusionsoft.com/api/xmlrpc

Authorization: Bearer <access_token>
Content-Type: application/xml

<methodCall>
  <methodName>InvoiceService.createBlankOrder</methodName>
  <params>
    <param>
      <value><int>22</int></value>
    </param>
    <param>
      <value><string>hello world</string></value>
    </param>
    <param>
      <value><dateTime.iso8601>20080908T00:00:00</dateTime.iso8601></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
  </params>
</methodCall>

I always receive the following error:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <fault>
        <value>
            <struct>
                <member>
                    <name>faultCode</name>
                    <value>
                        <i4>0</i4>
                    </value>
                </member>
                <member>
                    <name>faultString</name>
                    <value>No method matching arguments: java.lang.Integer, java.lang.String, java.util.Date, java.lang.Integer</value>
                </member>
            </struct>
        </value>
    </fault>
</methodResponse>

I see I'm not the first to receive an error like this, however I have copy and pasted this request from your API documentation and I can't seem to figure out what I have wrong. My HTTP client is just POSTMAN, as I just wanted to get a request working before I start writing code. Any help would be much appreciated!

@mfairch
Copy link
Contributor

mfairch commented Jul 13, 2015

You are missing the API key. Replace "privateKey" with the api key found on the follow page: https://fm260.infusionsoft.com/app/miscSetting/itemWrapper?systemId=nav.admin&settingModuleName=Application&settingTabName=Application

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.createBlankOrder</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>22</int></value>
    </param>
    <param>
      <value><string>hello world</string></value>
    </param>
    <param>
      <value><dateTime.iso8601>20080908T00:00:00</dateTime.iso8601></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
  </params>
</methodCall>

@swyse5
Copy link
Author

swyse5 commented Jul 13, 2015

That worked, thank you. But I don't want to have to use the API key for every call. Is it possible to use the OAuth flow instead? I tried sending the access_token on the calls, like your docs say, but I got an 'Invalid key' error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants