ruby on rails - How to create a new content entry via Locomotive CMS RESTful API -


I created a site using locomotive CMS, I have created two content types called Photos and Galleries, these content types One relation is that I can create image galleries on my site.

I am currently trying to use the Restine API to create multiple content entries for the photo because it is hidden through a file.

I can connect to the API with no problem and modify site etc.

I would think that cURL will take the form of a new content entry:

  curl -X post-D'photo [image_id] = blah and photo [gallery] ] = 1234 and photo [file] = & lt; File path & gt; Photo [published] = true '' http: // & lt; Your site & gt; / Locomotive / api /current_site.json?auth_token=xxxx '  

Although I am unsure of how to pass a file in this command, I have substituted it for now, How to write a part?

My field is set for the photo as follows:

  field: - image_id: label: Image ID type: string required: right localized: incorrect - File: # Field Label Name: File Type: Required File: Correct Localized: Wrong - Gallery: # Field Label Name: Gallery Type: Is_to Required: Correct Localized: Wrong # Slug of Targeted Content Type (for example if this content Type is a comment) class_name: gallery    

I create a Ruby script for parsing files and post data to

  /locomotive/api/content_types/photos/entries.json?auth_token=XXXX    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -