•  
      request #6401 PUT /artifacts/:id issue with artifact links
    Infos
    #6401
    Laurent Delaigue (ldelaigue)
    2014-03-07 18:47
    2014-03-06 11:52
    6476
    Details
    PUT /artifacts/:id issue with artifact links
    I update an existing artifact which has a field of type art_link.
    I send this for the art_link field: {"field_id":2341,"links":[123, 125, 126]}, which is accepted by the server (I use to send another structure and received a message telling that an array of int was expected)
    Though the server accepts my update and applies it, it removes all elements from the artifact links.
    API
    6.10
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Manuel Vacelet (vaceletm)
    Closed
    Empty
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    What would be great is a standard format to describe all the details of the input format.

    One could call that a kind of Web Service Description Language on which we could agree and implement :p
    User avatar
    You're right, it works if I use this format.
    [{"id":123}, {"id:"456"}, ...]

    Looks like I was just mislead by the error message I got when I first submit a completely wrong data structure.
    You should check this message in the source code to make sure it doesn't happen again ;-)
    User avatar

    Sounds strange, I just gave it a try and it works with following format:

     {
          "field_id": 3595,
          "label": "Link",
          "links": [
            {
              "id": 480,
              "uri": "artifacts/480"
            },
            {
              "id": 481,
              "uri": "artifacts/481"
            },
            {
              "id": 381,
              "uri": "artifacts/481"
            }
          ]
        }

    Can you try with the latest version (6.11) tagged today ?

     


    • Status changed from New to Waiting for information
    • Assigned to changed from None to Manuel Vacelet (vaceletm)