Update Data Request

Update the metadata or authentication details of a pending Data Request.

(Please note that you cannot update a Data Request that has already been viewed or completed.)

See the Data Requests documentation for more information.

HTTP Request

PUT https://app.formapi.io/api/v1/data_requests/<DATA_REQUEST_ID>

Authentication

You must send an Authorization header with the value Basic followed by base 64 encoded token_id:token_secret.

For example: Authorization: Basic dG9rZW5faWQ6dG9rZW5fc2VjcmV0Cg==

See the Authentication documentation for more information.

Example Response

{
  "status": "success",
  "data_request": {
    "id": "drq_000000000000000001",
    "email": "[email protected]",
    "name": "John Doe",
    "order": 1,
    "fields": ["description"],
    "metadata": {
      "user_id": 42
    },
    "state": "complete",
    "viewed_at": "2018-10-23T13:00:00Z",
    "completed_at": "2018-10-23T13:05:00Z"
  }
}

Example Code

var FormAPI = require("@formapi/formapi");

client = new FormAPI.Client(config);

client.updateDataRequest(
  "drq_000000000000000001",
  {
    auth_type: "oauth",
    auth_provider: "google",
    auth_session_started_at: "2018-10-23T13:00:00Z"
  },
  function(error, dataRequest) {
    if (error) throw error;
    console.log(dataRequest);
  }
);
require 'form_api'

formapi = FormAPI::Client.new

response = formapi.update_data_request(
  'drq_000000000000000001',
  auth_type: 'oauth',
  auth_provider: 'google',
  auth_session_started_at: '2018-10-23T13:00:00Z'
)
puts response
import form_api

client = form_api.Client()
response = client.update_data_request(
  "drq_000000000000000001",
  {
    "auth_type": 'oauth',
    "auth_provider": 'google',
    "auth_session_started_at": '2018-10-23T13:00:00Z'
  }
)
print(response)
<?php
$formapi = new FormAPI\Client();
$data_request_id = 'drq_000000000000000001';
$data = new FormAPI\Model\UpdateSubmissionDataRequestData();
$data->setAuthType('oauth');
$data->setAuthProvider('google');
$data->setAuthSessionStartedAt('2018-10-23T13:00:00Z');
$response = $formapi->updateDataRequest($data_request_id, $data);
echo $response;
using System;
using System.Diagnostics;
using FormApi.Client.Api;
using FormApi.Client.Client;
using FormApi.Client.Model;

namespace Example
{
    public class FormAPIExample
    {
        public void main()
        {
          var apiInstance = new PDFApi();
          string dataRequestId = "drq_000000000000000001";
          UpdateSubmissionDataRequestData data = new UpdateSubmissionDataRequestData(
            authType: CreateSubmissionDataRequestData.AuthTypeEnum.Oauth,
            authProvider: "google",
            authSessionStartedAt: "2018-10-23T13:00:00Z"
          );
          var response = apiInstance.UpdateDataRequest(dataRequestId, data);
          Debug.WriteLine(response);
        }
    }
}
export DATA_REQUEST_ID="drq_000000000000000001"

curl -s -X PUT "https://app.formapi.io/api/v1/data_requests/$DATA_REQUEST_ID" \
  -u "$API_TOKEN_ID:$API_TOKEN_SECRET" -d \
    '{ "auth_type": "oauth", "auth_provider": "google", "auth_session_started_at": "2018-10-23T13:00:00Z" }'

results matching ""

    No results matching ""