Workflow of vCO of query using the REST API in PowerShell

Hello

I am interrogating a workflow vCO by name using the REST API of PowerShell based on this article:

http://www.vcoteam.info/articles/learn-VCO/268-how-to-use-the-rest-API-to-start-a-workflow.html

$username = "XXXXXX".

$upassword = "XXXXXX".

$auth = $username + ':' + $upassword

$Encoded = [System.Text.Encoding]: UTF8. GetBytes ($auth)

$EncodedPassword = [System.Convert]: ToBase64String ($Encoded)

$headers = @{' authorization '=' basic $($EncodedPassword) ' ;}}

$body = "<-xmlns = execution context" ". ' http://www.VMware.com/VCO ' > < / execution context > '

#query for workflow named "donothing".

Invoke-RestMethod-uri https://XXXX:8281/api/flow /? conditions = name = donothing -Headers $headers - body $body - ContentType "application/xml" - Get method

Invoke RestMethod: failed to send a content-body with this type of verb.

On line: 1 char: 1

+ Call-RestMethod-uri https://XXXX:8281/api/flow /? conditions = name = donoth ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo: NotSpecified: (:)) [invoking-RestMethod], ProtocolViolationException)

+ FullyQualifiedErrorId: System.Net.ProtocolViolationException, Microsoft.PowerShell.Commands.InvokeRestMethodCommand

The request succeeds by using the customer REMAINS on Firefox, but I can't make it work on PowerShell. (NOTE: PowerShell workflow execution works very well)

Any help is appreciated.

Thank you

Juan.

OK, I managed to do work by removing

[System.Net.ServicePointManager]: ServerCertificateValidationCallback = {$true}

And add this at the beginning of the script

"Add-type @ '.

using System.Net;

using System.Security.Cryptography.X509Certificates;

public class TrustAllCertsPolicy: {ICertificatePolicy

public bool CheckValidationResult)

ServicePoint srvPoint, X509Certificate certificate,

WebRequest request, int certificateProblem) {}

Returns true;

}

}

"@

[System.Net.ServicePointManager]: CertificatePolicy = New-Object TrustAllCertsPolicy

Now I can use the GET method:

$ret = Invoke-WebRequest - uri $URL - Headers $headers - ContentType "application/xml" - Get method

I spent to Invoke-WebRequest so I can get the return of application Web.

Juan.

Tags: VMware

Similar Questions

  • Is there a way to get the data for submission of form of eloqua using the REST API?

    I was wondering if there is a way to get the data for submission of form of eloqua using the REST API?

    Thank you

    On the page that egan related, there is a 'RawData' field for FormSubmit activities. In this area, the raw sending the form query string is returned.

    Whatever it is, you can get this info from the activities of the API block, or the endpoints data Rest API.

  • Can not do a query with the REST api

    Hello

    After discovering that the use of the standard SOAP API what is like poking yourself in the eye with a sharp stick, I try to use the REST API. At first, I tried to exercise it through the extension of POSTMAN on Chrome. But I have no joy.

    Can I use caller ID to get the URL, so I know that my authentication is OK. But all other calls give me:

    Failure of 403 XSRF Protection


    Is an example of a call, that I'm trying:

    https://secure.Eloqua.com/API/rest/1.0/data/[email protected] & Count = 1

    I can't find any reference anywhere to this error 403.

    Help!

    Thank you

    Simon

    Hi Simon,.

    Looks like you're client (web browser) might have stored credentials for Eloqua, probably in the cookies collection. If you try to delete your cookies and rerun the query API with basic authentication, it should work.

    Hope this helps and please let us know if you need more information.

    Thank you

    Fred

  • vRO package import/export using the REST API, but what to rebuild a package?

    Hello

    I can export and import a package using the REST API. The package consists of all the workflows in a certain folder of the project.

    That's fine, but when we do another workflow example in the folder of our project, it is not automatically part of the package. This reduces the value of planning an export of it, because it would still this manual interaction.

    Is there a way to do it (automate/CLI/REST /...) this?

    Thank you!

    Ed

    Hello

    REST API for package management (adding/removing items to package, rebuild a package, etc.) are planned for the next version of vRO - vRO 7.1 (or whatever the COMP version it gets).

  • Get the 500 error trying to create a table using the REST API

    Hello

    I tried to create a table using the REST API for Business Intelligence Cloud, but I got 500 Internal Server Error for a while now.

    Here are the details that I use to create a table.

    Capture.JPG

    and the json to create the schema that I use is

    [{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ["ROWID"]}]

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['RELATIONID']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['ID']}

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['RESPONDEDDATE']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [255], 'columnName': ['RESPONSE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_CREATEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_CREATEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_LASTMODIFIEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_LASTMODIFIEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_SYSTEMMODSTAMP']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [10], 'columnName': ['SYS_ISDELETED']},

    [{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [50], 'columnName': ['TYPE']}]

    I tried this using postman and code, but I always get the following response error:

    Error 500 - Internal server error

    Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:

    10.5.1 500 internal Server Error

    The server encountered an unexpected condition which prevented him from meeting the demand.

    I am able to 'get' existing table schemas, delete the tables, but I'm not able to make put them and post operations. Can someone help me to identify the problem, if there is no fault in my approach.

    Thank you

    Romaric

    I managed to create a table successfully using the API - the only thing I see in your JSON which is different from mine is that you have square brackets around your values JSON where I have not. Here is my CURL request and extract my JSON file (named createtable.txt in the same directory as my CURL executable):

    curl u [email protected]: password UPDATED h x ' X-ID-TENANT-NAME: tenantname ' h ' Content-Type: application/json '-binary data @createtable.txt https://businessintell-tenantname.analytics.us2.oraclecloud.com/dataload/v1/tables/TABLE_TO_CREATE k

    [

    {

    'columnName': 'ID',

    'dataType': 'DECIMAL ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': false

    },

    {

    'columnName': 'NAME',

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'STATUS."

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'CREATED_DATE."

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    'columnName': 'UPDATED_DATE ',.

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    }

    ]

  • Using the REST API to delete the contact from the contacts list

    Hello world

    I am looking for some info for the creation of a request to delete a contact from a list of Contact using the REST API.   Here's what I have in Java where the contact id is 1 'and my list is 72'.     I'm open to responses in Java, c# or other languages.

    serverAddress = new URL ("https://secure.p03.eloqua.com/API/REST/1.0/assets/contact/list/72");

    establish communication stuff

    connection = null;

    Set up the initial connection

    connection = (HttpURLConnection) serverAddress.openConnection ();

    connection.setRequestMethod ("PUT");

    connection.setRequestProperty ("content-type", "json; charset=utf-8 ");"

    connection.setRequestProperty ("authorization", 'Basic BLOCKED');

    String body = '{\"membershipDeletions\":[\"1\']}";

    connection.setDoOutput (true);

    connection.getOutputStream () .write (body.getBytes ("UTF8"));

    connection.setReadTimeout (10000);

    Connection.Connect ();

    When I test with it I get a '400' HTTP response

    Thank you!

    Hi Noel,

    The following document describes the operations available for lists of contacts in the Rest API. Please note that we also have a project open source c# example illustrates the use of these endpoints.

    Repositories are all available to the public on Github. Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • How to set the time to preview using the REST Api of the assembler

    Hi all

    Using the REST API of the assembler, I can't feature "set the time to preview" to trigger a specific model that fires only at a specific time

    This is the format that I'm trying:

    http://xxxx:8006 / assembler/json/pages/home? Endeca_Time = 2020-04 - 05 T 14:30

    I use the correct format? This is the url parameter listed in the documentation of the Assembly

    Thank you

    It turns out that the documentation is wrong

    1. In assembler.properties (service\WEB-INF) of your REST API, you must define

      1. User.State.Ref = previewUserState
    2. You use Endeca_date and not Endeca_Time in the URL (documentation is wrong)
    3. Coding varies from a browser (you may need to URL encode the date in Firefox)

    Example:

    http://xxxx:8006 / assembler/json/pages/home? Endeca_date = 2020-01 - 11 T 18:00

    The date format is: YYYY-MM-dd' you HH: mm

  • How do to identify the documents called "models of library" using the RESTful API?

    How do to identify the documents called "models of library" using the RESTful API? Furthermore, what constitutes a document to be a "model of library"? I see nothing in the libraryDocuments RESTful documentation that describes this type of document, such as presented on the tab 'Manage' my developer account. Please see the screenshot below. There is a model of Document named "[DEMO ONLY] Test model" listed under "Library Templates" and I try to figure out which classifies that document to be included this way and how does produce a similar announcement by using the RESTful API.

    Screen Shot 2014-10-29 at 11.16.48 AM.png

    Thank you!

    Hello

    You can connect to access library models using the REST API, use 'GET /libraryDocuments' allowing to recover documents in library for a user. Models are created in the account of EchoSign, which later are accessible via the REST method mentioned above.

    Jat

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • How can I use the REST API to get general information of the user (Signature fields)?

    I'm trying to use the API to get the signature of all the users of the system fields. I can see this information in the web browser if I go to settings-> user management-> and selecting the user.

    I would like to know if there is a way to get the information General information (Signature fields) using the API.

    Thank you!

    Hi Sai,

    The REST API exposes the user records (see the following document); However, signature fields are not included. We need to work on this addition to the API (in a later version), but the option is currently not available.

    Please let me know if you have any questions or would like more information.

    Thank you

    Fred

  • Cannot add firewall rules using the REST API vShield App

    Hi all

    I get the following error

    "< errors > < error > < code > 100039 < / code > < description > Unmatched rules found in the configuration." "< / description > < / error > < / errors >.

    When you use the App API vSheild:

    POST https:// /API/2.0/app/firewall/dvportgroup-55/config < vsm-ip >

    Paylod XML:

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    < VshieldAppConfiguration >
    < firewallConfiguration = "dvportgroup-55" the contextId >
    < layer3FirewallRule disabled = "false" priority = "none" id = "1021" >
    < action > allow < / action >
    < connected > false < / connected >
    < source >
    < address >
    < ipAddress > 172.30.68.212 < / ipAddress >
    < / address >
    < > 222 portInfo < / portInfo >
    < / source >
    < destination >
    < address >
    < ipAddress > 172.30.68.166 < / ipAddress >
    < / address >
    < application >
    < > 333 portInfo < / portInfo >
    < Protocol > 6 < / Protocol >
    < / application >
    < / destination >
    < / layer3FirewallRule >
    < / firewallConfiguration >
    < / VshieldAppConfiguration >

    Is anyone has seen this before or any idea why this might be happening?

    In addition, create a wall of fire to provide the variable "id"... How do I know which id to use to create a new firewall rule. I'm using id = "1021" I see one last created after quesrying API... but when you call it through automation, what will the process to define an id invalid?

    Thank you

    xar

    ID must be present, for the new rule Id must be '0' while that for others it should kept as what. The reason for this error which I believe is the same. Replacement of 1021 with 0 should solve this problem. http://blogs.VMware.com/security/2011/11/using-the-VShield-API.html should also be useful to start with vShield firewall App REST API.

    -Kone

  • Access catalog getting and setting using the REST API

    I have a catalog I can see through the user interface which allows members to add in the tab share read-only, read/write or full control of the vCD. They do not appear anywhere that I can find when obtaining the catalog through the REST API.

    The REST API of 1.5 of vCloud Director documentation indicates that it supports the getting or setting user access to catalogs by using the link "conrolAccess". This link does not appear in the response to a GET the href of the catalog (admin or his substitute). Attempted to add "/ controlAccess" HREF catalogue translated by RESOURCE_NOT_FOUND.

    Hello

    Could be a bug in the documentation, try like this

    https://cloud/api/org/org-uuid/catalog/catalog-uuid/controlAccess - Fetch (GET)

    https://cloud/api/org/org-uuid/catalog/catalog-uuid/action/controlAccess - updated (AFTER)

    Kind regards
    Rajesh Kamal.

  • Query for all vApps expired using the REST API

    Hello

    I'm not able to find the query that will return me a list of vApps expired. I see that there are in the result set for the VAPP models that have isExpired field, but this field is missing for the result set of vApp. Does anyone know how to achieve this, I have no need of vApps query by one?

    Thank you

    Tomas

    The storage contract information is available only in the LeaseSettingsSection (aka LeaseSettingsSectionType), which I think is queryable by using the query service.

    The only place where I see a request that might work is the adminVApp query that has an autoDeleteDate attribute that seems to be the ISO 8601 timestamp when the (storage) lease expires or expired. Although I can't make it work in a filter expression because there is no date comparison operators, so you have to know the specific value to match on...

  • Uploading images using the REST API from PHP

    Does anyone at - he had success with the download of the images through the Eloqua Rest API using PHP?

    I have the final point, but I can't understand what kind of information needs to go the variable $data.

    That's what I currently have:

    <? PHP

    ini_set ("display_errors", 1);

    include("..) /.. ("/ eloquaRequest.php");

    $eloquaRequest = new EloquaRequest ('Instancename', 'username', 'password', 'https://secure.eloqua.com/API/REST/1.0');

    $data = new stdClass();

    $data-> image = file_get_contents("./easy.jpg");

    $data-> name = 'this is a file name ";

    $data-> filename = "luke.jpg";

    $data-> contentType = "image/jpeg";

    $response = $eloquaRequest-> message (' assets/image/content', $data);

    var_dump ($Response);

    The error I get is the following, but I think that it is a standard response, if your image does not go through correctly:

    Array (1) {[0] = > object (stdClass) #3 (2) {["type"] = > string(9) "FileError" ["requirement"] = > object (stdClass) #4 (3) {["type"] = > string (15) "SizeRequirement" ["maxSize"] = > int (52428800) ["minSize'] = > int (1)}}}

    Thank you

    Hi Phil,

    I had to find that it all the time, it took me several hours. I hope that it allows you to save a headache.

    Eloqua is very strict in dealing with the content-type header; See the comment here for a little explanation; REST API - download Images

    So what you need to do in PHP, is to build the query string for the image of yourself. You can do as follows (to adapt to your needs, not yet tested);

    <>

    [...]

    $img_path = '. / easy.jpg';

    $img_info = getimagesize ($img_path);

    $img_real = realpath ($img_path);

    $data = "-ELOQUA_BOUNDARY\r\n".

    ' Content-Disposition: form-data; name =-"Filedata\"; filename =------"".baseName ($img_real). » \"\r\n ».

    "Content-Type: '. '" $img_info ['mime']. "" \r\n ".

    "\r\n".

    file_get_contents() ($img_real). "" \r\n ".

    ' - ELOQUA_BOUNDARY - ';

    $headers = array ("Content-Length:".strlen ($data),"Content-Type: multipart/form-data;") Boundary = ELOQUA_BOUNDARY");

    $response = $eloquaRequest-> post (' assets/image/content', $data, $headers);

    ?>

    I have also adapted/reconstructed library Eloqua PHP in order to support the "BOLD" part. You must change the executeRequest function and add something like this to support change the request headers;

    curl_setopt ($this-> ch, CURLOPT_HTTPHEADER, $headers);

  • Perspective and visitors to the information using the REST API

    According to this post (Eloqua graphics API), visitors and prospects information is not available with the Eloqua REST API.

    With the Eloqua REST API there is a field that indicates whether a contact is a prospect or visitor?

    Hi Raghu,

    There is a new endpoint API (available with the Summer of Eloqua version), which allows you to retrieve a visitor profile.

    Please find some information on its use here: Eloqua API REST - recovery of visitor profiles

    T.J.

Maybe you are looking for