CPO 3.0 call a REST API

I try to call a remote REST API that returns a JSON object.

The call browser API looks like this

http://IPAM-dev/phpipam/API/?app_id=API&controller=sections&action=read&ID=6

Returns

{'success': true, 'data': {'id': '6', 'name': "Telford subnets", 'description': '',' masterSection': '0', 'permissions': "{\"4\":\"1\ ""} strictMode ',' ': '1', 'subnetOrdering': null, 'order': null, "editDate": null, "showVLAN": '0', 'showVRF': '0' "}}

When I try to use the OPC Web HTTP Request activity it fails with the following error

Unable to send a content-body with this type of verb.

I think the problem here is the content type. The default is application/xml; charset = utf - 8 in the activity, I tried to change this text, html and json, but still did not work. I can't let the emty content type in the activity.

Anyone have any suggestion how to make a REST of CPO call using the activity Web HTTP request

Try to change GET to POST (in the form of CALL-CPO_REST - RQ.png).  Sends the contents of the body generally requires a POST not a GET.

Tags: Cisco DataCenter

Similar Questions

  • Make a call to REST API through c# to 'change a fixed cost value.

    HI -.

    I am trying to make a call to REST API through c# for "change to a fixed cost value.

    I did successfully the following tasks via c# with the call of the API REMAINS the chargeback manager 2.0

    -Connection to the chargeback manager 2.0

    -Add a custom Chargeback hierarchy

    -Add vCenter Server entity in the hierarchy of Chargeback that was created by the REST API

    -Add the fixed cost model.

    But when I tried to use the REST API to 'change a value of fixed cost' based on the version of the document programming API 2.0.

    He is not successful... Here are the error messages and the code I had.

    Code:

    Public Shared ReadOnly Property ModifiyFixedCost (CookieContainer cookieContainer) as string
    {
    HttpWebRequest request;
    Stream streamReq;
    = request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/fixedCost/707/values"); )
    = //request (WebRequest.Create ("https://10.63.11.34/vCenter-CB/api/hierarchy/696/entity/697/costModel/701/fixedCosts/values"); )
    request. CookieContainer = cookieContainer;
    request. Method = "PUT";
    request. KeepAlive = true;
    request. Timeout = 600000;
    request. ContentType = "application/x-www-formulaires-urlencoded; application/x-www-form-urlencoded
    streamReq = request. GetRequestStream();

    Reading XML file.
    String strXML;
    String strCurrentPath = System.IO.Directory.GetCurrentDirectory;
    String strPath = "";
    strPath = strCurrentPath + "\\ModifiyFixedCostXML.txt";

    using (StreamReader sr = new StreamReader (strPath))
    {
    strXML = sr. ReadToEnd();
    }

    String strResp;
    Byte [] byteArray = Encoding.UTF8.GetBytes (strXML);
    streamReq.Write (byteArray, 0, byteArray.Length);
    streamReq.Close ();

    to using (WebResponse response = request. GetResponse())
    {
    Stream streamResp = response. GetResponseStream();
    StreamReader streamReaderResp = new StreamReader (streamResp);
    strResp = streamReaderResp.ReadToEnd ();
    }
    Return strResp;
    }

    XML file:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < application >
    < FixedCosts >
    < FixedCost id = "1" >
    values <>
    < value >
    < cost > 3.14 < / cost >
    < span id = "1" / >
    < / value >
    < / value >
    < / FixedCost >
    < / FixedCosts >
    < / request >

    Error messages;

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < response xmlns =" http://www.VMware.com/vCenter/chargeback/2.0 "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " status = "Failure" > ""

    < majorErrorCode error = '500' minorErrorCode = '0' message = "No such method defined or an API call lack of required arguments. / >

    < / answer >

    Please explain what is the problem here... Is the chargeback REST API c# 2.0 support?

    Thank you

    Yale

    Yale,

    I see the following changes are required in the application:

    1. URL is missing, the startTime and endTime, if the end time is not required to send it as -1. For example: http://localhost: 8080/vCenter-CB/api/fixedCost/553/values? startTime = endTime =-1 & 1340130600000
    2. In XML, fixed cost id must be the same as that mentioned in the URL. XML tag is

    Thank you

    Diomande

  • pass the header Http in the REST API of OSB

    Hello

    I have to call a REST API of the OSB.

    The API is available over HTTPS via https://xyz.com:1234

    It is also possible to send the authentication in the HTTP "Authorization" header This is done by sending a base 64 encoded string which consists in 'name' in this case means "key:

    (i.e. no password is used and the API key as username).

    For example if the API key is "abc123" encoded string 64 base would be "YWJjMTIzOg ==" and would be the header:

    Authorization: Basic YWJjMTIzOg is

    I created http based service Business where I invoke removal of HTTP request method.  I use the basic authentication option and have created a passage of the service account for this.

    This service of the company is called by another proxy HTTP based service where I created added an HTTP header named authorization and I'm passing key in there.

    But it gives me error " "" Basic realm ="Please enter a valid user name and password" ", " " and I am sure that the key is the right.

    Is the right way or am I missing something?

    Pointers and suggestions are much appreciated.

    With respect,

    Hard

    Thnx kpchong. I got it somehow work. It was to define the header.

    The trick is, you need to define a custom http header to transport

    Name:-authorization

    Value:-Basic "base 64 encoded key.

    With respect,

    Hard

  • Calling REST API security token error simple GET method

    Please help me get past this error. I have yet to get a successful REST API request of Eloqua. API is enabled for our sandbox that I managed by instantiating different SOAP request/response.

    This is my test RequestURI

    https://secure.Eloqua.com/API/rest/2.0/data/contact/3

    With the method 'GET' headers appropriate and what I have collected of their API guides, including the very useful

    Eloqua REST API - authentication

    Eloqua REST API - URL parameters

    Eloqua REST API - HTTP request headers

    RequestURI works when typed manually into a authenticated (connected to the Eloqua Sandbox session) tab of the FireFox browser.

    When I try the request in my tools (middleware Tibco integration, acting as a client HTTP request), I always get the answer:

    A security token that is associated with your session became invalid.

    I saw this topic, but this was not useful in my case.

    http://topliners.Eloqua.com/message/20371#20371

    The behavior in my case is pretty consistent, and seems not to care if I even spoil RequestURI making it invalid. The same error persists.

    Help, please! Thank you

    Heath

    A more complete answer follows:

    < RequestActivityOutput >

    < header > HTTP/1.1 200 OK

    Content-Type: text/html; charset = utf-8

    Content-Length: 2355

    Date: Friday, April 19, 2013 19:43:19 GMT

    cache-control: private

    connection: close

    P3P: CP = "IDC DSP COR DEVa TAIa OUR PHY ONL UNI COM NAV CNT STA BUS."

    < / header >

    < statusLine >

    < httpVersion > HTTP/1.1 < / httpVersion >

    < statusCode 200 > < / statusCode >

    < reasonPhrase > OK < / reasonPhrase >

    < / statusLine >

    ....

    A security token that is associated with your session became invalid.

    This can happen if you open multiple instances of Eloqua, in

    different browser Windows or tabs, then the diary of one of

    These instances.  Please either close this window or tab, or

    & lt; a href = "" / FormsLogin.aspx "target ="_top"> click here to connect to new & lt;" /a >. & lt; br >

    Heath,

    I'm not able to simply navigate to this URL in my browser either, even though I am connected to my sandbox (which has access to the API). I don't know how you manage to get there in Firefox.

    That being said, I can hit this page of the REST API very well when I base64 encode my credentials HTTP as described here:

    Eloqua REST API - authentication

    May be useful to take a look at the auth string you use when calling from rest.

    Jim

  • REST api call for the properties of the object in the html bridge provides resource not found (404) error.

    Hello

    I added a bridge Html summary view to our existing plugin (which is in Flex). The html page is displayed in the Summary tab with static data like images and titles. But the .gestJSON of the REST api call fails with the error ' could not load resources: the server responded with a 404 (Not Found) status.

    I followed the bridge Html sample chassisB (chassis - summary.js and html) to create the new page.

    Web.XML of the user interface of the plugin is configured to map/rest / *. bean dataAccessController is defined in the bundle context.

    Java package has the DataAccessController same class as the DataAccessController chassisB class

    This is the URL that I see in the javascript debugger and call API is a failure for this url.  There is no error in the virgo.log.

    https:// /vsphere-client/webui_ui_ns/rest/data/properties/323de5b9-4D2E-4dd7-ae32-98277dd44e90%252Fmf8k-h38?properties=name,model,version < vcenter ip >

    webui_ui_ns-client/vSphere is the value of Web-ContextPath in the plugin MANIFESTO. MF

    I spent a lot of time to understand the issue, but no luck. What I'm doing wrong here? Any help is appreciated.

    version of vCenter server appliance 6.0.0

    SDK - vSphere SDK Web 5.5.0

    1.7.0_79 64-bit JDK

    Thank you

    Deepa

    It was a configuration problem. I missed the tag in the bundle context of spring.

    After you add the 2 lines, it worked.

    Thanks for your time.

  • 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

  • Question on calls of vChargeBack rest api using PHP

    I try to log in to vCenter using vChargeBack API in PHP. I am having some problems when trying to call the rest service.

    My code

     
    $xmlfile=simplexml_load_file('login.xml'); 
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_POST, 1);   
    curl_setopt($ch, CURLOPT_POSTFIELDS,$xmlfile);//Passing XML file as POST field 
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);   
    curl_setopt($ch, CURLOPT_URL,"https://xx.xx.xx.xx/vCenter-CB/api/login"); //Setting URL   
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);   
    curl_setopt($ch , CURLOPT_SSL_VERIFYPEER , false );//Since I am requesting https 
    curl_setopt($ch , CURLOPT_SSL_VERIFYHOST , false );//Since I am requesting https 
    curl_setopt($ch, CURLOPT_HTTPHEADER, array ('Accept: ' . "application/xml" )); 
    $response=curl_exec($ch);//Getting response 
    $responseInfo=curl_getinfo($ch);//Getting response headers
    echo $response;
    print_r($responseInfo);
    
    
    
    
    
    


    I have to pass the request as XML data in the body of the request. And also I have version as an URL parameter (I tried from version by adding? version = 1.5.0 to the URL). My XML file request is

      <?xml version="1.0" encoding="UTF-8"?>
    <Request xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0">
     <Users>
      <User>
      <Type>local</Type>
      <Name>admin</Name>
      <Password>xxxxxxxx</Password>
      </User>
     </Users>
    </Request>


    When I try to run it, I get the status code 400 (Bad Request). Y at - it something I am doing wrong? Please help me out of this problem.

    Kind regards

    Srinath

    Hello Srinath.

    After some research, I was able to make calls from rest of chargeback API using PHP.

    I used this RestClient (full credit to the author):

    http://www.PhpClasses.org/package/5480-PHP-send-Web-services-requests-to-rest-servers.html

    With this class, using the API is quite simple:

    include 'library/RestClient/RestClient.class.php';
    
    $chargeBack = RestClient::post(
                $vCenter_chargebackBaseURL."/login?version=1.0.1",
                ''.
                ''.
                ''.
                'local'.
                ''.$vCenter_chargebackUsername .''.
                ''.$vCenter_chargebackPassword.''.
                ''.
                '',
                null,
                null,
                "application/xml"
                ); 
    
    var_dump($chargeBack->getResponse());
    var_dump($chargeBack->getResponseCode());
    var_dump($chargeBack->getResponseMessage());
    var_dump($chargeBack->getResponseContentType());
    

    Please, note that I had to add this line to the RestClient.class.php file inside the constructor method:

    curl_setopt ($this-> curl, CURLOPT_SSL_VERIFYPEER, false);

    Read this to learn more on this line and alternatives:

    http://unitstep.net/blog/2009/05/05/using-curl-in-PHP-to-access-HTTPS-ssltls-protected-sites/

    I hope this helps.

    Kind regards.

  • Question on the REST API

    Good evening everyone,

    I have a question for OTHER APIs.  I need to find or install some kind of library in order to to use?

    Thanks in advance,
    Peter

    If you plan to call any rest based Web service in your application then you don't need to add/import any new library.

  • REST API: How to create e-mail/landing page with static/dynamic content?

    With the REST API, it seems that you can create/update the contents of an e-mail or a landing page by specifying html with the type "RawHtmlContent". How it works when this e-mail or a landing page includes a shared or dynamic content? What is the recommended method to create or update an e-mail/landing page and add a new shared or dynamic, content or update the "reference"?

    Unfortunately this is not currently supported by our API.  However, we are building a new point extension called content Cloud that can solve your use case.

  • 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

  • Updated filter shared via the REST API

    Hello I'm trying to update a shared API filter. I'm using PHP and client fredsakr/eloqua-php-application · GitHub.

    So far, I was able to retrieve the filter with the following call:

    <?php
    require('./eloquaRequest.php');
    $eloquaRequest = new EloquaRequest('site', 'User.Name', 'password', 'https://secure.eloqua.com/API/REST/1.0');
    $response = $eloquaRequest->get('assets/contact/filters?search=TheFilterName&depth=complete');
    print_r($response);
    ?>
    

    I can see the filter in the answer below:

    (
        [type] => ContactFilter
        [currentStatus] => Active
        [id] => 100761
        [createdAt] => 1380137168
        [createdBy] => 48
        [depth] => complete
        [folderId] => 1036
        [name] => TheFilterName
        [updatedAt] => 1383589417
        [updatedBy] => 48
        [count] => 254382
        [criteria] => Array
            (
                [0] => stdClass Object
                    (
                        [type] => ContactFieldCriterion
                        [id] => 1912
                        [condition] => stdClass Object
                            (
                                [type] => TextSetCondition
                                [operator] => in
                                [optionListId] => 193
                            )
    
                        [fieldId] => 100012
                    )
    
            )
    
        [lastCalculatedAt] => 1380137190
        [scope] => global
      statement] => 1912
    

    What I want to do is update that corresponds to the values of 'Compare the Contact fields' in the GUI Eloqua under Contact = > Shared Library = > Contact filters.

    Looks like he has the "[type] = ContactFieldCriterion" under the [criteria] field in the response.

    I'd get how this value in a call to REST, and also how I would update it.

    Please let me know if you need more details on this issue. Please help and thank you.

    After some research I found what I wanted to do has been updated the list of options for this filter. See http://topliners.eloqua.com/docs/DOC-3588 for documentation on the base object. But I had difficulty in updating an OptionList with the Rest API using PUT. If you can help, please visit http://topliners.eloqua.com/message/36739#36739 . Thank you.

  • Search REST API by updatedAt?

    Hello

    I tried to do a search by updatedAt through the REST API.  I was not able to run.  Is it possible to do this research?

    I tried using the time at the time, and I tried to use the date mm/dd/yyyy yyyy/mm/dd formats.  Maybe I have not just magical format?

    Also, I tried using both a greater - than > and more-than-or-equal to > =.  So, my parameters could look like:? page = 1 & search = updatedAt > = 1371745091806

    The exact error message is: "invalid query".

    Thoughts?

    .  Topher

    Hello

    I was finally able to find a way to do it.  Thus, for posterity:

    The trick is that you do not use the parameter "search".  There is a separate parameter just to get data updated since a precise timestamp.  It is called lastUpdatedAt (rather than updatedAt).  The value of the parameter is applied as a filter ' greater than or equal to "and is in seconds since the epoch (Jan 1, 1970).

    Thus, for example:

    GET /API/REST/1.0/assets/campaigns?page=1&lastUpdatedAt=1369841921

    The trick who told me there was that I noticed on the campaigns page list call included a separate parameter for lastUpdatedAt.

    http://topliners.Eloqua.com/docs/doc-3091

    .  Topher

  • Can download us all active content using Rest APIs or limited?

    Hello

    Wanted to understand... based on the component library, what type of goods/content we can download in Eloqua (E10) before we are planning for resources. (images, hyperlinks field merge, shared, content, dynamic content in page Signature, Signature rule)?

    I understand E-mail headers and footers are already included.

    Thank you

    Amit Pandya

    apandya Yes you can. You can download the static and dynamic content by launching the REST API calls. See below for an example doc.

    REST API - download Images

  • REST API - the internal names of the fields in the custom object

    Hello

    We have an old system that uses the SOAP API and I'm rewritten with the REST API. Before, with SOAP, you identify the fields object personalized with their internal names. Therefore, our system and stored that names in its database. Now, I'm facing a problem. as the REST API does not provide the internal names for the fields in the custom object, as their full names and IDs. Am I wrong? Is it possible to get the internal names through REST? I found, you can get this internal names through the API as a WHOLE, but is there really no way to get them using REST? It seems strange to me and I don't want to use in BULK as there limits for requests per day.

    Hi Marc,

    In bulk API endpoints are the best way to retrieve the details field you are looking for.  Calls to retrieve this detail do not count against the daily API limits for the bulk API.

  • REST API - POST: / data/Objetpersonnalise / {id}

    Is there a specific documentation describes to the REST API - data object customPOST call?


    I tried a few different ways to call it without success, some of which are described below.


    This is the custom, object that I work with:

    Table

    (

    [type] = > Objetpersonnalise

    [id] = > 19

    [depth] = > full

    [description] = > custom Description of object

    [name] = > custom Elomentary Test object

    [fields] = > Array

    (

    [0] = > array

    (

    [type] = > CustomObjectField

    [id] = > 131

    [depth] = > full

    [name] = > testing a ground

    [type] = > text

    [displayType] = > text

    [internalName] = > Test_field_one1

    )

    [1] = > array

    (

    [type] = > CustomObjectField

    [id] = > 132

    [depth] = > full

    [name] = > two field Test

    [type] = > text

    [displayType] = > text

    [internalName] = > Test_field_two1

    )

    )

    )

    I tried a few different methods to make this request, but I'll try to refrain from posting a wall of the code, and I'll put everything that I think is most close to being correct based on some examples to

    Looking at the test customObjectData-helper to, eloqua-samples/customObjectData-helper/CustomObjectDataTests to fredsakr/eloqua-samples of master · GitHub

    Request URL: https://secure.p03.eloqua.com/api/rest/2.0/data/customObject/19

    The raw request:

    POST /api/rest/2.0/data/customObject/19 HTTP/1.1

    Host: secure.p03.eloqua.com

    User-Agent: Elomentary (http://github.com/tableau-mkt/elomentary)

    Content-Type: application/json

    Content-Length: 90

    {"fieldValues can only be": [{'id': 131, 'value': 'testing123'}, {'id': 132, "value": "alkfjsaldkjfasldjka"}]}

    And the response headers:

    HTTP/1.1 404 not found

    Cache-Control: private

    Content-Length: 1565

    Content-Type: text/html; Charset = UTF-8

    P3P: CP = "" IDC DSP COR DEVa TAIa OUR PHY ONL UNI COM NAV CNT STA BUS ","

    Date: Tuesday, July 29, 2014 14:32:22 GMT

    cannot get property

    The body of the response:

    <? XML version = "1.0" encoding = "utf-8"? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < title > < /title > Service

    < style > < / style >

    < / head >

    < body >

    < div id = "content" >

    < class p = "title 1" > Service < /p >

    < p > endpoint could not be found. < /p >

    < / div >

    < / body >

    < / html >

    Parris,

    Endpoint for the creation of object (custom p03) data seems to have been replaced by:

    POST Api/rest/1.0/data/customObject/{customObjectId}

    Endpoint you are trying to use has worked before. I don't know what happened... I found this useful documentation:

    https://secure.P03.Eloqua.com/API/docs/dynamic/rest/1.0/reference.aspx

    Jason Kay

Maybe you are looking for