Jump to content
  • 0

JSON array view creation


MrJack

Question

Hi,
 

I have some sample JSON from a 3rd party system that i am using to test a POST into a view so that we can accept information from their systems automatically.
(https://c3abv412.caspio.com/rest/swagger#/Views/ViewsV2_PostRecords)

 

SAMPLE JSON

{
    "Booking": {
        "TransactionID": "324065",
        "ModifyUserID": "",
        "SiteItemID": "1074272",
        "ReferrerID1": "book.test.co.uk",
        "ReferrerID2": "",
        "SiteItemName": "test Cruise",
        "SystemTimeZone": "",
        "DisplayTimeZone": "",
        "BookingMode": "B",
        "Online": "true",
        "ExternalIP": "195.01.01.01",
        "Application": "B2B",
        "Affiliate": {
            "ID": "1074272",
            "ExternalReference1": "BHXPV33",
            "ExternalReference2": "",
            "sid1": "book.test.co.uk",
            "sid2": "",
            "sid3": ""}
        }

}

I have created 2 tables, 1st "Booking" and 2nd "Affiliate" and have replicated the parameters included in the JSON above - and added both to a view.

However, when testing i get a response of :

{
  "Code": "ColumnNotFound",
  "Message": "Cannot perform operation because the following field(s) do not exist: 'Booking'",
  "Resource": "https://c3abv412.caspio.com/rest/v2/views/Odysseus/records?response=ok",
  "RequestId": "9CD844C3-B3F8-4D45-981B-E2979811E74F"
}

 

Why is it expecting a "Booking" column with the JSON being formatted this way? It seems to be valid JSON.

Can anyone help me?

Thanks

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello @MrJack,

First of all, if you have a View that consists of 2 or more tables, only one of them can be editable. 

W3RWzjC.png

This means that you can insert a new record, and update or delete an existing record only in an editable table. 

Since you need to post into 2 Tables as far as I understood, you need to post into the Tables and not into the View.

 

As for the JSON format, the accepted format is the following:

{
"field_name": "value",
"another_field_name": "value"
}

So, the first property inside the object is considered to be the field name. This is why you see the error saying the "Booking" field does not exist. 

 

And if you want to create a View by the POST request, I don`t see the method for this in Swagger UI. 
Mx7Bdvm.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...