Sending a Template to Sign

Sending a Template to Sign

hi, trying to send a template to be signed using this as a test:


$accessToken = "1000.xxx"
$templateId  = "1234"


$payload = @{
  templates = @(
    @{
      template_id  = $templateId
      request_name = "blah blah"
      actions = @(
        @{
          role            = "owner"
          action_type     = "SIGN"
          recipient_name  = "me"
          recipient_email = "me@me.me"
        }
      )
    }
  )
}

$form = @{
  data = ($payload | ConvertTo-Json -Depth 10)
}

$response = Invoke-RestMethod `
  -Method POST `
  -Uri $uri `
  -Headers @{
    Authorization = "Zoho-oauthtoken $accessToken"
  } `
  -Form $form

$response


but im just hitting a brick wall with these errors:

Invoke-RestMethod:
{
  "code": 9106,
  "error_param": "templates",
  "message": "Invalid JSON format",
  "status": "failure"
}


Any help appreciated !