restApi running api/actions with fixlet reference returns 500 error

My POST code works fine for creating actions with an XML content that has the relevance statement and actions but not when I am referencing the fixlet directly. I am on EM 9.2:

Documentation I referenced:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Action

My API call:
https://serverName:port/api/actions

My XML (I pulled the site and fixlet Ids from the API and tested them by calling the details of them via the API):

<?xml version="1.0" encoding="UTF-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
	<SourcedFixletAction>
		<SourceFixlet>
		<SiteID>1002</SiteID>
		<FixletID>20</FixletID>
		<Action>Action1</Action>
		</SourceFixlet>
		<Target>
			<ComputerID>2957017</ComputerID>
		</Target>
	</SourcedFixletAction>
</BES>

I must have done something wrong. the target computerID is right and I also tried the tag.
Does anyone have the API call and XML?
Better yet, can someone spot an error in what I am doing?

thanks.

Error 500 is internal server error, so that is puzzling.

I did a sanity check for you using cURL. I use your XML document as is exactly, except changing the IDs for Site, Fixlet and Computer.
The POST to /actions work correctly for me.

curl -k -X POST -d @test.xml -u leewei:mypassword https://localhost:52311/api/actions

My test.xml looks like this.
We will need more info to figure out what went wrong.

<?xml version="1.0" encoding="UTF-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
    <SourcedFixletAction>
        <SourceFixlet>
        <SiteID>1</SiteID>
        <FixletID>679</FixletID>
        <Action>Action1</Action>
        </SourceFixlet>
        <Target>
            <ComputerID>11577043</ComputerID>
        </Target>
    </SourcedFixletAction>
</BES>

The run command along with the results.

C:\Program Files\cURL\bin>curl -k -X POST -d @test.xml -u leewei:welcome https://localhost:52311/api/actions
<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
        <Action Resource="http://localhost:52311/api/action/469" LastModified="Fri, 31 Jul 2015 21:41:45 +0000">
                <Name>Clear BES Local Download Caches</Name>
                <ID>469</ID>
        </Action>
</BESAPI>

Thank you leewei for running that.

I will have to take a look at the server logs to see what is being thrown.
Can you tell me what version of IBM BigFix your sanity check was run against?

littlefix

I was running against 9.0.853 and I just pointed to 9.2.5.130.
Both ran successfully.

thank you so much leewei, you were a tremendous help.
I had the sitenumber wrong.
after a few tries with siteName I was successful.

1 Like