Update a Profile

Accepts an UpdateProfileRequest object.

Returns a ProfileResponse object.

Example (Ruby)

require 'uri'
require 'net/http'

url = URI("https://api.opentransact.com/v1/profiles/#{profile_id}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["authorization"] = "Bearer #{API_KEY}"
request["content-type"] = 'application/vnd.api+json'
request.body = {
	"data": {
		"type": "profiles",
		"id": profile_id,
		"attributes": {
			"owner": {
				"type": "people",
				"first-name": "John",
				"last-name": "Clancy"
			}
		},
		"relationships": {
			"application": {
				"data": {
					"type": "applications",
					"id": $APPLICATION_ID
				}
			}
		}
	}
}.to_json

response = http.request(request)
puts response.read_body

Example (cURL)

curl --request PUT \
  --url https://api.opentransact.com/v1/profiles/$PROIFLE_ID \
  --header 'authorization: Bearer $API_KEY' \
  --header 'content-type: application/vnd.api+json' \
  --data '{
	"data": {
		"type": "profiles",
		"id": "$PROFILE_ID",
		"attributes": {
			"owner": {
				"type": "people",
				"first-name": "John",
				"last-name": "Doe"
			}
		},
		"relationships": {
			"application": {
				"data": {
					"type": "applications",
					"id": $APPLICATION_ID
				}
			}
		}
	}
}'