Skip to main content
changes in body; code format
Source Link
Krishna Mohan
  • 6.3k
  • 9
  • 30
  • 55

Here is the URL to access a node with file already attached to it

{domain_name}/[end-point]/node/219.json

Here 219 is the nid of the node.

Here is the sample JSON format to attach a file to node (node create).

{
    "title": "title_of_node",
    "type": "bundle_name",
    "field_samplefile": {
        "und": [{
            "fid": "17",
            "filename": "changes.txt",
            "uri": "public://changes.txt",
            "filemime": "text/plain"
        }]
    } 
}

Here is the URL to access a node with file already attached to it

{domain_name}/[end-point]/node/219.json

Here 219 is the nid of the node.

Here is the sample JSON format to attach a file to node (node create).

{"title":"title_of_node","type":"bundle_name","field_samplefile":{"und":[{"fid":"17","filename":"changes.txt","uri":"public://changes.txt","filemime":"text/plain"}]}}

Here is the URL to access a node with file already attached to it

{domain_name}/[end-point]/node/219.json

Here 219 is the nid of the node.

Here is the sample JSON format to attach a file to node (node create).

{
    "title": "title_of_node",
    "type": "bundle_name",
    "field_samplefile": {
        "und": [{
            "fid": "17",
            "filename": "changes.txt",
            "uri": "public://changes.txt",
            "filemime": "text/plain"
        }]
    } 
}
Source Link
Krishna Mohan
  • 6.3k
  • 9
  • 30
  • 55

Here is the URL to access a node with file already attached to it

{domain_name}/[end-point]/node/219.json

Here 219 is the nid of the node.

Here is the sample JSON format to attach a file to node (node create).

{"title":"title_of_node","type":"bundle_name","field_samplefile":{"und":[{"fid":"17","filename":"changes.txt","uri":"public://changes.txt","filemime":"text/plain"}]}}