Choctaw Artist Registry API

This doc is a work in progress.

Necessary Secrets:

# Chahta Achʋffa Artist API Keys
define( 'SECRET_URL', '' );
define( 'SECRET_FUNCTIONS_KEY', '' );
define( 'SUBSCRIPTION_KEY', '' );
define( 'ACCESS_URL', '' );
define( 'ACCESS_CLIENT_ID', '' );
define( 'ACCESS_SCOPE', '' );
define( 'ARTIST_URL', '' );

Step 1: OAuth flow to get data

Data schema

type ArtistResponse = {
  "@odata.context": string; 
    value: Array<{
        PersonProfileID:number;
        PersonID:number;
        FirstName:string;
        LastName:string;
        City:string|null;
        StateCode:string|null;
        Phone:string|null;
        Email:string|null;
        Pseudonym:string|null;
        ArtStyle:Array<"Traditional"|"Contemporary">|null;
        ArtClassifications:Array<"Consumer Arts"|"Literary Arts"|"Performance Art"|"Traditional Choctaw Art"|"Visual Arts">|null;
        PhotoOfArt:null;
    }>;
    "@odata.nextLink"?:string;
}

Step 2: Transform Data to WP Post Array

  1. Destructure data from response into a flat array, adding a “sort_name” key if artists use a pseodonym
  2. Check if the artists exists; if so, add the ID to the post array

See something inaccurate?