Jump to content

SonniT

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by SonniT

  1. Thanx for your reply.

    I tried removing the column you requested but it didn't work im affraid.

    The column types are as follows

    {"TestTable1_ProduktId (integer)":4,"TestTable1_TestTable1Id (autonumber)":43,"TestTable1_VilHaSMS (yes/no)":true,"TestTable2_DatoOprettet (date/time)":"2019-03-19T10:49:37","TestTable2_TestTable1Id (integer)":43,"TestTable2_SMS_sendt (yes/no)":true}

    In the Swagger UI it has a q.where clause that i don't use in the php-script - might that pose a problem? If so - how do i use that? (sorry if the question might be a bit basic).

    Regards,

    Sonni T.

  2. Hi all

    I am trying to update a view in Caspio that consists of 2 tables using PHP and the REST API - but i keep getting errors.

    I am trying to update the view using the JSON below ($postdata)

    {"PK_ID":"48,100","TestTable1_ProduktId":4,"TestTable1_TestTable1Id":43,"TestTable1_VilHaSMS":true,"TestTable2_DatoOprettet":"2019-03-19T10:49:37","TestTable2_TestTable1Id":43,"TestTable2_SMS_sendt":true}

    and this php-script

    $url = $this->resource_url . '/views/my-test-view/records';
    $auth = 'Bearer my-test-token';
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "PUT",
        CURLOPT_POSTFIELDS => $postdata,
        CURLOPT_HTTPHEADER => array(
            "authorization:" . $auth,
            "cache-control: no-cache",
            "content-type: application/json",
            'Content-Length: ' . strlen($postdata)
        )
    ));

    I keep getting this error:

    Message":"Cannot perform operation because the body parameter is absent or invalid.

    What am i doing wrong?

    'Looking forward to hearing from any of you :-)

     

    Sonni T.

×
×
  • Create New...