BioloMICS logo
×
BioloMICS Web Menu

Files (FLink) in API

 
An FLink field is link field pointing to one or several files in a target table.
 
In a POST request there are two possible json representations depending on the needs.
 
  • Content_Type = “application/json” (default)

        
     
    By default, (Flink) and all-other links, are represented as an array of numbers, this representation is used for associate existing file(s) to a deposit using only unique identifier(s) (id(s)).

    The input json should be structured in the following way:

     
    {
      "name": "new deposit",
      "sequenceFiles": [1, 2, 3 ……  ]
    }
     
  • Content-Type = “application/links+json”

        

     
    This representation is used to associate new file(s) to a deposit.
     
    The input json should be structured in the following way:



    “FileContent” is the target file to be inserted which is a pair of “name” and “content”, the content should be structured in a base64 string format.
     
    It is possible to use a tool to generate base64 from a file like the one below:

    https://base64.guru/converter/encode/file

    {
      "name": "new deposit",
      "sequenceFiles": [
        {
          "fileContent": {
            "name": "new file",
            "content": "YWN0Zw=="
          }
        }
      ]
    }
     
    The request input should be in the following configuration.