XPP REST Client Query Para

What should a query string format be to execute a POST against XPP Server via XPP Rest API client? The help does not make much sense. When executed, it is asking for a Process ID number 

Run XPP commands on a Division or Job.

NOTE: The 'command' parameter is the program to run and must be located in the 'xz/bin' directory. For example, divtrace, divflags, show_xref, see Command Line Utilities

The caller is responsible for all options.

GET

/xpp/docs/:path/processes/command

Parameter

Field Type Description
command String

The name of the XPP commmand (in xz/bin) to run

optionsoptional String

Additional 'command' options

ecodeoptional String

error code for exit criteria 1 => OK if 0 >= exitcode < 128 (default=0)

path String

The "logical" 4/5-part path to a Division or Job in the form "handle:class:group:job:div"

nowaitoptional String

If "nowait=true", the command will return immediately with the id, code, and time the command started (default="false"). The user can check for command completion, by using the 'xpp/docs/processes/id' endpoint; where 'id' is the id used to get the status of the running program (default="false"). See Command Status for the command to determine the status of a 'nowait' program.

Allowed values: "true", "false"

emoji
  • Hi all,

    Good news! I have found the solution. The fix was in the options arguments and the query format string. I was not only able to get successful compose command using a REST API call but also execute the sdedit. See the correct query string format with options below:

    servername:2995/.../sdedit div -aout MattTaylor -xml

    emoji
  • Bart,

    Thank you for the push. Your answer came close enough. However, the REST API call rejected the options, and I designed the string a different way, and that was fixed.

    Regards,

    Matt

    emoji
  • Hi Matt,

    Actually, it "did" work (using the ecode=1 parameter).

    The "message" response you've shown coming back from REST is the (error) messages out of running an (invalid) "xppversion -cd path" command, that I had mentioned you should expect with \r\n in the "message" value signifying the carriage returns in the messages (with slight variations due to my having paths on Linux and you on WIndows, and a bigger variation on the second error message due to my using a Linux path starting with a slash and you having a Windows path starting with a D: drive).

    And the response "code" of "1" jives with what I said was the error exit value of running an (invalid) xppversion -cd command. Because you specified the ecode=1 parameter, REST did not treat the exit value of "1" as an error (and that's why you got back the "message" value with the error messages instead of a "failed command" response you got before).

    In any case, I'm glad you finally got some "real" commands working with the REST API.

    Jonathan Dagresta
    RWS Group/
    XPP Development

    emoji
  • Matt,

    It all depends if the software you are using is doing the url encoding for you are not.
    The real command that gets send is using url encoding in which the spaces are replaced by %20.
    Apparently in your case the software you were using was doing the url encoding for you..

    But hey I am glad you got things to work for you.
    It is a nice (and easy once you found out how it works) way of driving the system, don't you think so?

    emoji
1 2