PingOne Platform APIs

Update Verified Data Portrait Background

   

POST {{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}

Use the POST {{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}} request to update the background of the specified self portrait (selfie) on the specified verify transaction for the user in the environment. This request, in effect, crops the face out of the selfie and drops it on a uniform background of the color defined in the backgroundColor object.

This request requires a custom Content-Type of application/vnd.pingidentity.replace.background+json.

This request can only be called after verification of the user.

Request Model

Refer to Verified data portrait background data model for full property descriptions.

Property Type Required

backgroundColor

Object

Required

backgroundColor.red

Integer

Required

backgroundColor.green

Integer

Required

backgroundColor.blue

Integer

Required

aspectRatio

Object

Required

aspectRatio.aspectHeight

Integer

Required

aspectRatio.aspectWidth

Integer

Required

Headers

Authorization      Bearer {{accessToken}}

Content-Type      application/vnd.pingidentity.replace.background+json

Body

raw ( application/vnd.pingidentity.replace.background+json )

{
    "backgroundColor": {
        "red": 179,
        "green": 40,
        "blue": 45
    },
    "aspectRatio": {
        "aspectHeight": 4,
        "aspectWidth": 3
    }
}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}' \
--header 'Content-Type: application/vnd.pingidentity.replace.background+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
    "backgroundColor": {
        "red": 179,
        "green": 40,
        "blue": 45
    },
    "aspectRatio": {
        "aspectHeight": 4,
        "aspectWidth": 3
    }
}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.replace.background+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@"    ""backgroundColor"": {" + "\n" +
@"        ""red"": 179," + "\n" +
@"        ""green"": 40," + "\n" +
@"        ""blue"": 45" + "\n" +
@"    }," + "\n" +
@"    ""aspectRatio"": {" + "\n" +
@"        ""aspectHeight"": 4," + "\n" +
@"        ""aspectWidth"": 3" + "\n" +
@"    }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}"
  method := "POST"

  payload := strings.NewReader(`{
    "backgroundColor": {
        "red": 179,
        "green": 40,
        "blue": 45
    },
    "aspectRatio": {
        "aspectHeight": 4,
        "aspectWidth": 3
    }
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/vnd.pingidentity.replace.background+json")
  req.Header.Add("Authorization", "Bearer {{accessToken}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
POST /environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}} HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.replace.background+json
Authorization: Bearer {{accessToken}}

{
    "backgroundColor": {
        "red": 179,
        "green": 40,
        "blue": 45
    },
    "aspectRatio": {
        "aspectHeight": 4,
        "aspectWidth": 3
    }
}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.replace.background+json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"backgroundColor\": {\n        \"red\": 179,\n        \"green\": 40,\n        \"blue\": 45\n    },\n    \"aspectRatio\": {\n        \"aspectHeight\": 4,\n        \"aspectWidth\": 3\n    }\n}");
Request request = new Request.Builder()
  .url("{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}")
  .method("POST", body)
  .addHeader("Content-Type", "application/vnd.pingidentity.replace.background+json")
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/vnd.pingidentity.replace.background+json",
    "Authorization": "Bearer {{accessToken}}"
  },
  "data": JSON.stringify({
    "backgroundColor": {
      "red": 179,
      "green": 40,
      "blue": 45
    },
    "aspectRatio": {
      "aspectHeight": 4,
      "aspectWidth": 3
    }
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}',
  'headers': {
    'Content-Type': 'application/vnd.pingidentity.replace.background+json',
    'Authorization': 'Bearer {{accessToken}}'
  },
  body: JSON.stringify({
    "backgroundColor": {
      "red": 179,
      "green": 40,
      "blue": 45
    },
    "aspectRatio": {
      "aspectHeight": 4,
      "aspectWidth": 3
    }
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests
import json

url = "{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}"

payload = json.dumps({
  "backgroundColor": {
    "red": 179,
    "green": 40,
    "blue": 45
  },
  "aspectRatio": {
    "aspectHeight": 4,
    "aspectWidth": 3
  }
})
headers = {
  'Content-Type': 'application/vnd.pingidentity.replace.background+json',
  'Authorization': 'Bearer {{accessToken}}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/vnd.pingidentity.replace.background+json',
  'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n    "backgroundColor": {\n        "red": 179,\n        "green": 40,\n        "blue": 45\n    },\n    "aspectRatio": {\n        "aspectHeight": 4,\n        "aspectWidth": 3\n    }\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"

url = URI("{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.replace.background+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
  "backgroundColor": {
    "red": 179,
    "green": 40,
    "blue": 45
  },
  "aspectRatio": {
    "aspectHeight": 4,
    "aspectWidth": 3
  }
})

response = http.request(request)
puts response.read_body
let parameters = "{\n    \"backgroundColor\": {\n        \"red\": 179,\n        \"green\": 40,\n        \"blue\": 45\n    },\n    \"aspectRatio\": {\n        \"aspectHeight\": 4,\n        \"aspectWidth\": 3\n    }\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/users/{{userID}}/verifyTransactions/{{transactionID}}/verifiedData/{{selfieID}}")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.replace.background+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()

Example Response

200 OK

{
    "_links": {
        "self": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5a942438-cca2-4edd-ac53-c1384c6e0329/verifyTransactions/46a76722-9d9f-4ad0-816d-c7fc981be6a9/verifiedData/c1f147d7-dca5-3788-ad6e-453468875b41"
        },
        "environment": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
        },
        "user": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5a942438-cca2-4edd-ac53-c1384c6e0329"
        },
        "verifyTransaction": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5a942438-cca2-4edd-ac53-c1384c6e0329/verifyTransactions/46a76722-9d9f-4ad0-816d-c7fc981be6a9"
        }
    },
    "id": "ef6cd8cd-d869-4695-af69-29c78b6f041a",
    "type": "SELFIE",
    "data": {
       "format": "JPEG",
       "image" : "/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDUuMC4xMwAA/9sAQwABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB/9sAQwEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE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