APIM REST API - How to add an API with operations?

When I issue a PUT to /apis/{aid} with import=true and contentType = application/json, I get an 400 BadRequest if the body contains operations.  Note that I'm
not using WADL or Swagger format, and am building the JSON request body instead as per the documentation.  
The error returned in the response body is:
{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"operations","message":"Invalid
field 'operations' specified"}]}}
If I omit the operations field from the request body, the API is created correctly (but with no operations of course).  
To illustrate, here is the RAW request (slightly modified to remove the authorization and instance names):
PUT https://testinstance.management.azure-api.net/apis/123456?api-version=2014-02-14-preview&import=true HTTP/1.1
Authorization: SharedAccessSignature . . .
Content-Type: application/json; charset=utf-8
Host: testinstance.management.azure-api.net
Content-Length: 414
Expect: 100-continue
Connection: Keep-Alive
{"name":"Customer","description":"This API is used to manage customers","serviceUrl":"http://www.somewebsite.com/customers","path":"customers","protocols":["http","https"],"operations":[{"id":"/apis/123456/operations/a04b16da-29b7-44f5-95a3-25603dbc9b6d","name":"Customer
(Get)","description":"Returns information about the customer with the specified ID.","method":"GET","urlTemplate":"/customers/{customerId}"}]}
The JSON looks correct to me - can anyone spot what I'm doing wrong?  Can you provide a RAW request that works?
Note also that I've not included the "path" query string parameter, even though the documentation suggests that it is required when import=true.  Since there is no easy way to update APIs/Operations en masse, I'm having to resort to driving
the APIM REST API and could use some additional documentation for this specific operation.

Just updating this thread with the answer...my request body was malformed - I was using an array of objects for the operations field instead of a complex object representing the collection.
So instead of this:
"operations": [
...I should have been using this:
"operations": {
    "value": [
You can see the correctly formatted payload in the sample response body returned from the
GetApi endpoint.
Thanks to Vlad for pointing out my mistake!

Similar Messages

  • How to add Excise item with out chapter id

    Dear all,
    How to add Excise item with out chapter id?
    Chapter id of purchae items will be known only after receiving Invoice/gate pass/delivery  chalan from supplier/vendor
    To send a purchase order we need to create that particular item in the master, but with out assigning chapter id system is  not allowing to save without chapter id.
    How to solve this?
    I am with SAP 8.8 and PL 10
    Thanks in advance
    regards,
    Kumar

    Hi Kumar,
    Refer the book of chapter ID or find out on internet you will get the chapter ID.
    Still if you not able to get  the chapter id then consult with excise advisory.
    But you can add Excise PO until you have the excise details in Item master.
    Regards,
    Datta Kharat

  • Need detailed procedure on how to add an item with Item Style Check Box in

    Need detailed procedure on how to add an item with Item Style Check Box in Framework.

    The view instance should be the same as the view instance (view object) specified for your region.
    If the View Attribute already that you need already exists in the View Object then you can use it.
    Otherwise you have to extend the View Object and add the new attribute to it.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SharePoint 2010 Rest API: How to add attachment to a list item via ListData.svc

    Hi
    I have set up a project using the REST API in c# Visual Studio 2010.
    I have added a service reference to the URL //site/_vti_bin/listdata.svc/
    I can query the list and get back data, but I can't retrieve the attachments.
    I can write data to the list, but I can't add attachments.
    Are there any examples of how to add or retrieve attachments using the REST API services.
    Thanks
    Mike

    Hi,                                                             
    If you want to work with list attachments using REST API, here are some links will show how to do this using Javascript:
    http://msdn.microsoft.com/en-us/library/office/dn292553.aspx#FileAttachments
    http://chuvash.eu/2013/02/20/rest-api-add-a-plain-text-file-as-an-attachment-to-a-list-item/
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/06/27/how-to-get-list-item-attachments-using-rest-and-javascript-in-sharepoint-2013.aspx
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to add a Link with children in the SuiteLink bar?

    Hello,
    I have developed a code to add a new link in the SuiteLink bar using delegate control that works as expected. Now I want to include a new link
    but with children, I have tried many options in my code but with not luck.
    What I need in the SuiteLink bar is something like:
    My Services   Newsfeed  OneDrive  Sites
        Service 1
        Service 2
        Service 3
    Any idea on how to achieve this?
    Thanks,
    Daniel
    Daniel Villacis

    Hi,
    According to your post, my understanding is that you want to add sublink in the top navigation bar.
    There is an article about this issue, it contains the steps about how to create a link with sublink in the top navigation bar, you can have a look at it.
    http://www.helpmeonsharepoint.com/2012/03/custom-sharepoint-top-menu-and.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • How to add new value in operator in search parameter in web ui

    Hi,
    I have a requirement to add values (equal ,not equal ) in operator drop-down field of
    search parameter in search of web ui page.
    Can someone guide me to proceed on this.
    Thanks
    Viren

    Hi,
    here an example how to add operator "contains pattern" to attribute prospect name in the opportunity search.
    Hopefully it will work similar for your issue:
    1) Launch transaction 'sm34'
    2) Enter view cluster name as 'CRMVC_DQ' and click on 'Maintain'
    3) Find DQuery Object Name for example 'BTQOpp' under Comp Name 'BT' and click on'exceptions per attribute.'
    4) Find the Attribute Name for example 'PROSPECT_NAME'
    5) Check the box 'CP' to enable to 'contains' operator.
    Kind regards
    Manfred

  • Adobe Reader - how to add page numbers with the free version?

    Hey guys,
    Imagine I've got a PDF file and I want to create a new one by selecting some pages out of it. I know this is simply possible by using the PDFcreator but I want to add page numbers. As far as I know this is not possible with the free version of Adobe unless I would add the page number on every single page by using a text box. I want to make different catalogs from the PDF so the page numbers are really necessary. Have you got any idea how to solve that issue? You know that's pretty much the only thing I need to add which means it's not worth buying the Pro version. Unfortunately I only got the PDF and I can't work on it e.g. with MS word before I export it. Do you know if there is a way to add page numbers with a free version? There might be an additional free software which allows that?
    Thanks for your support! 

    Thanks for your quick replies.
    I know how to add text page by page. But obviously it's hard to place the numbers on the very same position, is it?

  • How to add a button with Javascript to Library

    Hi
    I am using Captivate 5.5 to create a template.
    In the files which will be created using this template, we will be adding a button which executes a Javascript. Now, my question is, since this button will be used on multiple slides in the file, can I add this button (with the Javascript) to the library? Currently, we create it manually everytime.
    We don't have a programmer in our team, so we can't create widget. Is there an alternative way?
    Thanks for your help.
    Sreekanth

    Thanks for that reply.
    I now have a blank slide with the button (including the javascript) on it which solves the problem of importing it manually.
    However, when we use this template to import PowerPoint presentations, when we publish the file, the first slide (the one on which I have this button) will be blank and has to be manually deleted.
    Is there a way to eliminate this manual work? I tried hiding and using some actions. But it was not of any use.

  • How to add custom columns with BO data from GP to UWL

    Hi
    We have CE 7.1 in our project UWL taskitems only have GP workflow tasks.
    In UWL we can see that by default there are standard columns but now we need to add custom columns with data from ours BO associated to process instance
    For that we need to develop one custom connector for UWL where we can retrieve the values from custom conenctor to UWL.
    Currently our NWDS 7.1 does not have plugins for UWL Connector can anybody tell me where can I download this plugins?
    thanks in advance!
    Regards
    Cristian

    Hi,
    plz refer the following link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ee5047-c7a0-2a10-70b7-9557e3e4d440
    Regards
    Manohar

  • Document Search - how to add new document with link to ALL

    CRM 5.0,  can easily add documents in the ICWC under the Document Search or gui t-code CRM_KW but the linkage is to me.   How can I change or create the link to to "ALL" so all users can find them in the search.

    Hi Glenn,
    Just to clarify for other readers, I assume you are referring to the document search functionality in the Interaction Center that uses Content Management to search for documents and link them to the current business transaction, the current account (business partner) or the current agent/user?
    I am not aware of any out of the box method for linking a document to all CRM users or agents. But if you want to have a look around at the code, I think the class and methods you might want to start with class CL_CRM_IC_CUCOCM_IMPL method REGISTER_*.
    Maybe someone else has an idea how to link multiple users/agents (e.g. all users belonging to a particular org unit or profile) at once, instead of only linking the current user/agent?
    Warm regards,
    John

  • How to add Portal iViews with Web Page Composer

    Hi,
    We are working with Web Page Composer in EP7.0 SP13.
    We are creating web pages and we would need to add Portal iViews into. When we try to add an iView, we cannot select it from Web Content Browser to drop into the web page container.
    How can we add iViews into our web pages?
    Helpful answers will be rewarded!!
    Thanks in advance,
    Samantha.

    Hi,
    See these:
    [http://help.sap.com/saphelp_nw70/helpdata/en/06/4776399abf4b73945acb8fb4f41473/frameset.htm]
    [/message/4414263#4414263 [original link is broken];
    Best regards,
    Avishai Zamir

  • How to add Currency field with dropdown on screen layout (module pool)

    I need to add a field called <b>Currency( field label )</b> with <b>dropdown (like SKB1-WAERS). </b>
    The <b>field label</b> and <b>input output field </b> should default as being hidden and
    sould be visible only when other field value ( on the same screen ) should match with the value in the database table . 
    Could you please suggest me how to create dropdown
    and give this functionality with coding ?
    Thanks in advance.

    Hi,
    In the field attributes of the SKB1-WAERS..in the group attributes..give a group name G1..Add the same G1 for the field lable also.
    Then in the PBO of the screen..
    ***Check the conditions..when other field value (on the same screen) matches
    ***with the value in the database table.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'G1'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Thanks,
    Naren

  • How to add a UDF with picture data type by using metadata object?

    Hi guys,
    does anybody have a clue on how to code user fields metadata object (via VB6) in order to add a picture type field? I can't find the enum number for this data type in the DI help file.
    Best Regards,
    Oki

    Hi,
    The field type should be BoFieldTypes.db_Alpha , and the subtype BoFldSubTypes.st_Image .
    And it is in the DI documentation (look at the SubType property).
    Regards,
    Ibai Peñ

  • CUOM - How to add IP address with hostname (device name)

    Hello all,
    I have a quick question regarding CUOM(Operation Manager).
    How I could add devices' hostname to CUOM for monitoring?
    I could add IP address as below ,  if I only add IP address, then it looks NO "device name' field which I could add.
    Devices ->Device Management->Add  Devices
    Thank you for your help in advance.
    Howard

    It is resolved by updating host file on CUOM server.

  • How to add a JPanel with label and border line

    hi,
    I want a Jpanel with label and border line like this.Inside it i need to have components.Is there a resuable component to bring this directly??
    Any solution in this regards.???
    Label-----------------------------------------------------------
    | |
    | |
    | |
    | |
    | |
    |________________________________________ |

    [url http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html]How to Use Borders

Maybe you are looking for