Update a Credential Type
PUT {{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}
Use the PUT {{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}} operation to update a specific type of credential for issuance. A credential type corresponds to the Card type presented by the compatible wallet app.
If the updated credential type differs from the existing credential type, the service saves the existing credential type as a Credential Type Version and increments version.number in the updated credential type. Credential Type Versions can be read with Read All Credential Type Versions.
If you change management.mode from AUTOMATED to MANAGED and an associated issuance rule exists, the rule is disabled, but not deleted. If you change management.mode from MANAGED to AUTOMATED and no credential issuance rule exists for that credential type, no error occurs. That credential type is simply never issued.
Prerequisites
Create a credential type (automated) or Create a credential type (managed) to get a credentialTypeID for the endpoint. Refer also to Credential Types.
If management.mode is AUTOMATED, you can value one and only one of the three properties in the expiration object and the associated credential issuance rule automatically assigns an expiration date when it issues the credential. If management.mode is MANAGED and an expiration object is present, it causes an error.
If you want to change management.mode from AUTOMATED to MANAGED, but one of the three properties in the expiration object is valued, the body must have no expiration object, which removes it from the credential type, and set management.mode to MANAGED.
Request Model
Refer to Credential Types data model for full property descriptions.
| Property | Type | Required? |
|---|---|---|
|
String |
Required |
|
String |
Optional |
|
String |
Optional |
|
Object |
Optional |
|
Object |
Required/Optional |
|
Integer |
Required |
|
String |
Required |
|
String |
Required/Optional |
|
String |
Required/Optional |
|
DateTime |
Required/Optional |
|
String |
Required |
|
String |
Optional |
|
String |
Optional |
|
Object |
Required |
|
Object |
Optional |
|
String |
Required |
|
Boolean |
Optional |
|
String |
Required |
|
String |
Optional |
metadata object data model
| Property | Type | Required? |
|---|---|---|
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
Object[] |
Optional |
|
String |
Required/Optional |
|
String |
Optional |
|
String |
Required |
|
Boolean |
Required |
|
Boolean |
Optional |
|
String |
Required |
|
String |
Required |
|
String[] |
Required/Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
Body
raw ( application/json )
{
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"bgOpacityPercent": 20,
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
}
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff --request PUT '{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"bgOpacityPercent": 20,
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Put);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@" ""title"": ""Card Developers""," + "\n" +
@" ""description"": ""PingOne Credentials""," + "\n" +
@" ""management"": {" + "\n" +
@" ""mode"": ""MANAGED""" + "\n" +
@" }," + "\n" +
@" ""cardType"": ""Card Developers""," + "\n" +
@" ""metadata"": {" + "\n" +
@" ""name"": ""Card Developers""," + "\n" +
@" ""description"": ""PingOne Credentials""," + "\n" +
@" ""textColor"": ""#000000""," + "\n" +
@" ""cardColor"": ""#FFFFFF""," + "\n" +
@" ""backgroundImage"": ""data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=""," + "\n" +
@" ""logoImage"": """"," + "\n" +
@" ""bgOpacityPercent"": 20," + "\n" +
@" ""fields"": [" + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> Name""," + "\n" +
@" ""title"": ""Name""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""name.formatted""," + "\n" +
@" ""required"": false" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> Street Address""," + "\n" +
@" ""title"": ""Street Address""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""streetAddress""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> City""," + "\n" +
@" ""title"": ""City""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""locality""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> State""," + "\n" +
@" ""title"": ""State""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""region""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> Zip Code""," + "\n" +
@" ""title"": ""Zip Code""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""postalCode""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Alphanumeric Text -> Endorsements""," + "\n" +
@" ""title"": ""Endorsements""," + "\n" +
@" ""isVisible"": true," + "\n" +
@" ""type"": ""Alphanumeric Text""," + "\n" +
@" ""value"": ""None""," + "\n" +
@" ""required"": false" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""bgOpacityPercent"": 20," + "\n" +
@" ""version"": 4" + "\n" +
@" }," + "\n" +
@" ""cardDesignTemplate"": ""<svg xmlns=\""http://www.w3.org/2000/svg\"" viewBox=\""0 0 740 480\""><g><rect fill=\""none\"" width=\""736\"" height=\""476\"" stroke=\""#808993\"" stroke-width=\""3\"" rx=\""10\"" ry=\""10\"" x=\""2\"" y=\""2\""></rect><rect fill=\""${cardColor}\"" height=\""476\"" rx=\""10\"" ry=\""10\"" width=\""736\"" x=\""2\"" y=\""2\""></rect><image href=\""${backgroundImage}\"" opacity=\""${bgOpacityPercent}\"" height=\""476\"" rx=\""10\"" ry=\""10\"" width=\""736\"" x=\""2\"" y=\""2\""></image><text fill=\""${textColor}\"" font-weight=\""450\"" font-size=\""30\"" x=\""160\"" y=\""80\"">${cardTitle}</text><text fill=\""${textColor}\"" font-size=\""25\"" font-weight=\""300\"" x=\""160\"" y=\""120\"">${cardSubtitle}</text><image href=\""${logoImage}\"" x=\""42\"" y=\""43\"" height=\""90px\"" width=\""90px\""></image><line xmlns=\""http://www.w3.org/2000/svg\"" y2=\""160\"" x2=\""695\"" y1=\""160\"" x1=\""42.5\"" stroke=\""#808993\""></line><image href=\""data:image/jpeg;base64,${fields[0].value}\"" x=\""42.5\"" y=\""180\"" rx=\""80px\"" ry=\""80px\"" height=\""130px\"" width=\""130px\""></image><text fill=\""${textColor}\"" font-weight=\""500\"" font-size=\""20\"" x=\""190\"" y=\""230\"">${fields[1].title}: ${fields[1].value}</text><text fill=\""${textColor}\"" font-weight=\""500\"" font-size=\""20\"" x=\""190\"" y=\""272\"">${fields[2].title}: ${fields[2].value}</text><text fill=\""${textColor}\"" font-weight=\""500\"" font-size=\""20\"" x=\""190\"" y=\""314\"">${fields[3].title}: ${fields[3].value}</text></g></svg>""," + "\n" +
@" ""onDelete"": {" + "\n" +
@" ""revokeIssuedCredentials"": true" + "\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}}/credentialTypes/{{credentialTypeID}}"
method := "PUT"
payload := strings.NewReader(`{
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"bgOpacityPercent": 20,
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/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))
}
PUT /environments/{{envID}}/credentialTypes/{{credentialTypeID}} HTTP/1.1
Host: {{apiPath}}
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"bgOpacityPercent": 20,
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"title\": \"Card Developers\",\n \"description\": \"PingOne Credentials\",\n \"management\": {\n \"mode\": \"MANAGED\"\n },\n \"cardType\": \"Card Developers\",\n \"metadata\": {\n \"name\": \"Card Developers\",\n \"description\": \"PingOne Credentials\",\n \"textColor\": \"#000000\",\n \"cardColor\": \"#FFFFFF\",\n \"backgroundImage\": \"data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=\",\n \"logoImage\": \"\",\n \"bgOpacityPercent\": 20,\n \"fields\": [\n {\n \"id\": \"Directory Attribute -> Name\",\n \"title\": \"Name\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"name.formatted\",\n \"required\": false\n },\n {\n \"id\": \"Directory Attribute -> Street Address\",\n \"title\": \"Street Address\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"streetAddress\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> City\",\n \"title\": \"City\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"locality\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> State\",\n \"title\": \"State\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"region\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> Zip Code\",\n \"title\": \"Zip Code\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"postalCode\",\n \"required\": true\n },\n {\n \"id\": \"Alphanumeric Text -> Endorsements\",\n \"title\": \"Endorsements\",\n \"isVisible\": true,\n \"type\": \"Alphanumeric Text\",\n \"value\": \"None\",\n \"required\": false\n }\n ],\n \"bgOpacityPercent\": 20,\n \"version\": 4\n },\n \"cardDesignTemplate\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 740 480\\\"><g><rect fill=\\\"none\\\" width=\\\"736\\\" height=\\\"476\\\" stroke=\\\"#808993\\\" stroke-width=\\\"3\\\" rx=\\\"10\\\" ry=\\\"10\\\" x=\\\"2\\\" y=\\\"2\\\"></rect><rect fill=\\\"${cardColor}\\\" height=\\\"476\\\" rx=\\\"10\\\" ry=\\\"10\\\" width=\\\"736\\\" x=\\\"2\\\" y=\\\"2\\\"></rect><image href=\\\"${backgroundImage}\\\" opacity=\\\"${bgOpacityPercent}\\\" height=\\\"476\\\" rx=\\\"10\\\" ry=\\\"10\\\" width=\\\"736\\\" x=\\\"2\\\" y=\\\"2\\\"></image><text fill=\\\"${textColor}\\\" font-weight=\\\"450\\\" font-size=\\\"30\\\" x=\\\"160\\\" y=\\\"80\\\">${cardTitle}</text><text fill=\\\"${textColor}\\\" font-size=\\\"25\\\" font-weight=\\\"300\\\" x=\\\"160\\\" y=\\\"120\\\">${cardSubtitle}</text><image href=\\\"${logoImage}\\\" x=\\\"42\\\" y=\\\"43\\\" height=\\\"90px\\\" width=\\\"90px\\\"></image><line xmlns=\\\"http://www.w3.org/2000/svg\\\" y2=\\\"160\\\" x2=\\\"695\\\" y1=\\\"160\\\" x1=\\\"42.5\\\" stroke=\\\"#808993\\\"></line><image href=\\\"data:image/jpeg;base64,${fields[0].value}\\\" x=\\\"42.5\\\" y=\\\"180\\\" rx=\\\"80px\\\" ry=\\\"80px\\\" height=\\\"130px\\\" width=\\\"130px\\\"></image><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"230\\\">${fields[1].title}: ${fields[1].value}</text><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"272\\\">${fields[2].title}: ${fields[2].value}</text><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"314\\\">${fields[3].title}: ${fields[3].value}</text></g></svg>\",\n \"onDelete\": {\n \"revokeIssuedCredentials\": true\n }\n}");
Request request = new Request.Builder()
.url("{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}")
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}",
"method": "PUT",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{accessToken}}"
},
"data": JSON.stringify({
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'PUT',
'url': '{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
},
body: JSON.stringify({
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}"
payload = json.dumps({
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": True,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": False
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": True,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": True
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": True,
"type": "Directory Attribute",
"attribute": "locality",
"required": True
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": True,
"type": "Directory Attribute",
"attribute": "region",
"required": True
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": True,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": True
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": True,
"type": "Alphanumeric Text",
"value": "None",
"required": False
}
],
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": True
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n "title": "Card Developers",\n "description": "PingOne Credentials",\n "management": {\n "mode": "MANAGED"\n },\n "cardType": "Card Developers",\n "metadata": {\n "name": "Card Developers",\n "description": "PingOne Credentials",\n "textColor": "#000000",\n "cardColor": "#FFFFFF",\n "backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",\n "logoImage": "",\n "bgOpacityPercent": 20,\n "fields": [\n {\n "id": "Directory Attribute -> Name",\n "title": "Name",\n "isVisible": true,\n "type": "Directory Attribute",\n "attribute": "name.formatted",\n "required": false\n },\n {\n "id": "Directory Attribute -> Street Address",\n "title": "Street Address",\n "isVisible": true,\n "type": "Directory Attribute",\n "attribute": "streetAddress",\n "required": true\n },\n {\n "id": "Directory Attribute -> City",\n "title": "City",\n "isVisible": true,\n "type": "Directory Attribute",\n "attribute": "locality",\n "required": true\n },\n {\n "id": "Directory Attribute -> State",\n "title": "State",\n "isVisible": true,\n "type": "Directory Attribute",\n "attribute": "region",\n "required": true\n },\n {\n "id": "Directory Attribute -> Zip Code",\n "title": "Zip Code",\n "isVisible": true,\n "type": "Directory Attribute",\n "attribute": "postalCode",\n "required": true\n },\n {\n "id": "Alphanumeric Text -> Endorsements",\n "title": "Endorsements",\n "isVisible": true,\n "type": "Alphanumeric Text",\n "value": "None",\n "required": false\n }\n ],\n "bgOpacityPercent": 20,\n "version": 4\n },\n "cardDesignTemplate": "<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 740 480\\"><g><rect fill=\\"none\\" width=\\"736\\" height=\\"476\\" stroke=\\"#808993\\" stroke-width=\\"3\\" rx=\\"10\\" ry=\\"10\\" x=\\"2\\" y=\\"2\\"></rect><rect fill=\\"${cardColor}\\" height=\\"476\\" rx=\\"10\\" ry=\\"10\\" width=\\"736\\" x=\\"2\\" y=\\"2\\"></rect><image href=\\"${backgroundImage}\\" opacity=\\"${bgOpacityPercent}\\" height=\\"476\\" rx=\\"10\\" ry=\\"10\\" width=\\"736\\" x=\\"2\\" y=\\"2\\"></image><text fill=\\"${textColor}\\" font-weight=\\"450\\" font-size=\\"30\\" x=\\"160\\" y=\\"80\\">${cardTitle}</text><text fill=\\"${textColor}\\" font-size=\\"25\\" font-weight=\\"300\\" x=\\"160\\" y=\\"120\\">${cardSubtitle}</text><image href=\\"${logoImage}\\" x=\\"42\\" y=\\"43\\" height=\\"90px\\" width=\\"90px\\"></image><line xmlns=\\"http://www.w3.org/2000/svg\\" y2=\\"160\\" x2=\\"695\\" y1=\\"160\\" x1=\\"42.5\\" stroke=\\"#808993\\"></line><image href=\\"data:image/jpeg;base64,${fields[0].value}\\" x=\\"42.5\\" y=\\"180\\" rx=\\"80px\\" ry=\\"80px\\" height=\\"130px\\" width=\\"130px\\"></image><text fill=\\"${textColor}\\" font-weight=\\"500\\" font-size=\\"20\\" x=\\"190\\" y=\\"230\\">${fields[1].title}: ${fields[1].value}</text><text fill=\\"${textColor}\\" font-weight=\\"500\\" font-size=\\"20\\" x=\\"190\\" y=\\"272\\">${fields[2].title}: ${fields[2].value}</text><text fill=\\"${textColor}\\" font-weight=\\"500\\" font-size=\\"20\\" x=\\"190\\" y=\\"314\\">${fields[3].title}: ${fields[3].value}</text></g></svg>",\n "onDelete": {\n "revokeIssuedCredentials": true\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}}/credentialTypes/{{credentialTypeID}}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
"title": "Card Developers",
"description": "PingOne Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "\#000000",
"cardColor": "\#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"\#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"\${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"\${backgroundImage}\" opacity=\"\${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"\${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">\${cardTitle}</text><text fill=\"\${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">\${cardSubtitle}</text><image href=\"\${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"\#808993\"></line><image href=\"data:image/jpeg;base64,\${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"\${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">\${fields[1].title}: \${fields[1].value}</text><text fill=\"\${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">\${fields[2].title}: \${fields[2].value}</text><text fill=\"\${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">\${fields[3].title}: \${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
}
})
response = http.request(request)
puts response.read_body
let parameters = "{\n \"title\": \"Card Developers\",\n \"description\": \"PingOne Credentials\",\n \"management\": {\n \"mode\": \"MANAGED\"\n },\n \"cardType\": \"Card Developers\",\n \"metadata\": {\n \"name\": \"Card Developers\",\n \"description\": \"PingOne Credentials\",\n \"textColor\": \"#000000\",\n \"cardColor\": \"#FFFFFF\",\n \"backgroundImage\": \"data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=\",\n \"logoImage\": \"\",\n \"bgOpacityPercent\": 20,\n \"fields\": [\n {\n \"id\": \"Directory Attribute -> Name\",\n \"title\": \"Name\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"name.formatted\",\n \"required\": false\n },\n {\n \"id\": \"Directory Attribute -> Street Address\",\n \"title\": \"Street Address\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"streetAddress\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> City\",\n \"title\": \"City\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"locality\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> State\",\n \"title\": \"State\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"region\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> Zip Code\",\n \"title\": \"Zip Code\",\n \"isVisible\": true,\n \"type\": \"Directory Attribute\",\n \"attribute\": \"postalCode\",\n \"required\": true\n },\n {\n \"id\": \"Alphanumeric Text -> Endorsements\",\n \"title\": \"Endorsements\",\n \"isVisible\": true,\n \"type\": \"Alphanumeric Text\",\n \"value\": \"None\",\n \"required\": false\n }\n ],\n \"bgOpacityPercent\": 20,\n \"version\": 4\n },\n \"cardDesignTemplate\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 740 480\\\"><g><rect fill=\\\"none\\\" width=\\\"736\\\" height=\\\"476\\\" stroke=\\\"#808993\\\" stroke-width=\\\"3\\\" rx=\\\"10\\\" ry=\\\"10\\\" x=\\\"2\\\" y=\\\"2\\\"></rect><rect fill=\\\"${cardColor}\\\" height=\\\"476\\\" rx=\\\"10\\\" ry=\\\"10\\\" width=\\\"736\\\" x=\\\"2\\\" y=\\\"2\\\"></rect><image href=\\\"${backgroundImage}\\\" opacity=\\\"${bgOpacityPercent}\\\" height=\\\"476\\\" rx=\\\"10\\\" ry=\\\"10\\\" width=\\\"736\\\" x=\\\"2\\\" y=\\\"2\\\"></image><text fill=\\\"${textColor}\\\" font-weight=\\\"450\\\" font-size=\\\"30\\\" x=\\\"160\\\" y=\\\"80\\\">${cardTitle}</text><text fill=\\\"${textColor}\\\" font-size=\\\"25\\\" font-weight=\\\"300\\\" x=\\\"160\\\" y=\\\"120\\\">${cardSubtitle}</text><image href=\\\"${logoImage}\\\" x=\\\"42\\\" y=\\\"43\\\" height=\\\"90px\\\" width=\\\"90px\\\"></image><line xmlns=\\\"http://www.w3.org/2000/svg\\\" y2=\\\"160\\\" x2=\\\"695\\\" y1=\\\"160\\\" x1=\\\"42.5\\\" stroke=\\\"#808993\\\"></line><image href=\\\"data:image/jpeg;base64,${fields[0].value}\\\" x=\\\"42.5\\\" y=\\\"180\\\" rx=\\\"80px\\\" ry=\\\"80px\\\" height=\\\"130px\\\" width=\\\"130px\\\"></image><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"230\\\">${fields[1].title}: ${fields[1].value}</text><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"272\\\">${fields[2].title}: ${fields[2].value}</text><text fill=\\\"${textColor}\\\" font-weight=\\\"500\\\" font-size=\\\"20\\\" x=\\\"190\\\" y=\\\"314\\\">${fields[3].title}: ${fields[3].value}</text></g></svg>\",\n \"onDelete\": {\n \"revokeIssuedCredentials\": true\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/credentialTypes/{{credentialTypeID}}")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "PUT"
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/credentialTypes/066ed561-34ba-4a50-a23d-98223ef7871a"
},
"environment": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"credentialIssuerProfile": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/credentialIssuerProfile"
}
},
"id": "066ed561-34ba-4a50-a23d-98223ef7871a",
"createdAt": "2025-10-31T13:00:29.376Z",
"updatedAt": "2025-10-31T13:04:35.842141835Z",
"environment": {
"id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"issuer": {
"id": "913c21bb-0570-426b-97c4-e4d56e8861a5"
},
"management": {
"mode": "MANAGED"
},
"title": "Card Developers",
"description": "PingOne Credentials",
"cardType": "Card Developers",
"uri": "https://api.pingone.com/v1/distributedid/credentialTypes/066ed561-34ba-4a50-a23d-98223ef7871a",
"version": {
"number": 2,
"uri": "https://api.pingone.com/v1/distributedid/credentialTypes/066ed561-34ba-4a50-a23d-98223ef7871a/v2",
"id": "89c4dbf6-d396-418f-9305-3aa9cedc3273"
},
"metadata": {
"name": "Card Developers",
"description": "PingOne Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": false
},
{
"id": "Directory Attribute -> Street Address",
"title": "Street Address",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "streetAddress",
"required": true
},
{
"id": "Directory Attribute -> City",
"title": "City",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "locality",
"required": true
},
{
"id": "Directory Attribute -> State",
"title": "State",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "region",
"required": true
},
{
"id": "Directory Attribute -> Zip Code",
"title": "Zip Code",
"isVisible": true,
"type": "Directory Attribute",
"attribute": "postalCode",
"required": true
},
{
"id": "Alphanumeric Text -> Endorsements",
"title": "Endorsements",
"isVisible": true,
"type": "Alphanumeric Text",
"value": "None",
"required": false
}
],
"version": 4
},
"cardDesignTemplate": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 740 480\"><g><rect fill=\"none\" width=\"736\" height=\"476\" stroke=\"#808993\" stroke-width=\"3\" rx=\"10\" ry=\"10\" x=\"2\" y=\"2\"></rect><rect fill=\"${cardColor}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></rect><image href=\"${backgroundImage}\" opacity=\"${bgOpacityPercent}\" height=\"476\" rx=\"10\" ry=\"10\" width=\"736\" x=\"2\" y=\"2\"></image><text fill=\"${textColor}\" font-weight=\"450\" font-size=\"30\" x=\"160\" y=\"80\">${cardTitle}</text><text fill=\"${textColor}\" font-size=\"25\" font-weight=\"300\" x=\"160\" y=\"120\">${cardSubtitle}</text><image href=\"${logoImage}\" x=\"42\" y=\"43\" height=\"90px\" width=\"90px\"></image><line xmlns=\"http://www.w3.org/2000/svg\" y2=\"160\" x2=\"695\" y1=\"160\" x1=\"42.5\" stroke=\"#808993\"></line><image href=\"data:image/jpeg;base64,${fields[0].value}\" x=\"42.5\" y=\"180\" rx=\"80px\" ry=\"80px\" height=\"130px\" width=\"130px\"></image><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"230\">${fields[1].title}: ${fields[1].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"272\">${fields[2].title}: ${fields[2].value}</text><text fill=\"${textColor}\" font-weight=\"500\" font-size=\"20\" x=\"190\" y=\"314\">${fields[3].title}: ${fields[3].value}</text></g></svg>",
"onDelete": {
"revokeIssuedCredentials": true
},
"systemProvided": false
}