### GraphQL Query Example Source: https://github.com/auctionedge/developer-access/blob/main/README.md This snippet shows a basic HTTP POST request to the /graphql endpoint to query auction assets. It includes example headers and a sample GraphQL query. Note that the query and schema details may not be current. ```APIDOC ## POST /graphql ### Description This endpoint allows you to query auction data using GraphQL. You need to provide a valid authorization token and an auction code. ### Method POST ### Endpoint /graphql ### Parameters #### Headers - **x-amz-user-agent** (string) - Required - User agent string. - **content-type** (string) - Required - Content type, typically application/json. - **accept-language** (string) - Optional - Preferred language. - **Authorization** (string) - Required - AccessToken or IdToken for authentication. #### Request Body - **query** (string) - Required - The GraphQL query string. - Example query structure: `query test { auction(id: "auction-code") { assets { purchased(pageRequest: { pageSize: 10, pageNumber: 1 }) { items { vin year make model exteriorColor } } } } }` ### Request Example ```HTTP POST /graphql HTTP/1.1 Host: {{api_host}} x-amz-user-agent: aws-amplify/2.0.1 content-type: application/json accept-language: en-US,en;q=0.9 Authorization: {{AccessToken or IdToken}} { "query": "query test { auction(id: \"auction-code\") { assets { purchased(pageRequest: { pageSize: 10, pageNumber: 1 }) { items { vin year make model exteriorColor } } } } }" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the result of the GraphQL query. - **auction** (object) - Information about the auction. - **assets** (object) - Assets within the auction. - **purchased** (object) - Purchased assets. - **items** (array) - List of purchased items. - **vin** (string) - Vehicle Identification Number. - **year** (string) - Manufacturing year. - **make** (string) - Vehicle make. - **model** (string) - Vehicle model. - **exteriorColor** (string) - Exterior color of the vehicle. #### Response Example ```json { "data": { "auction": { "assets": { "purchased": { "items": [ { "vin": "1GKS2HKJ3JR259932", "year": "2018", "make": "GMC", "model": "Yukon XL", "exteriorColor": "White" } ] } } } } } ``` ``` -------------------------------- ### Example Authentication Response JSON Source: https://github.com/auctionedge/developer-access/blob/main/README.md This is an example of the JSON response received after a successful authentication. The AccessToken, IdToken, and RefreshToken are crucial for subsequent API interactions. The ExpiresIn value indicates the token's validity period in seconds. ```json { "AuthenticationResult": { "AccessToken": "eyJraWQiOiI1RjYyeGZvalIxTWNOTjlhdlwvY2FES2N4NUVEUnFnSkpJZXU4MEtrSlJEaz0iLCJhbGciOiJSUzI1NiJ9...", "ExpiresIn": 3600, "IdToken": "eyJraWQiOiJyaTd4SHBYeXoyYm15cTl4aTBJbFBNWW54Ullid3ZhdURFdVBlTzdheldZPSIsImFsZyI6IlJTMjU2In0...", "RefreshToken": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ...", "TokenType": "Bearer" }, "ChallengeParameters": {} } ``` -------------------------------- ### Curl Command for GraphQL Query Source: https://github.com/auctionedge/developer-access/blob/main/README.md This example demonstrates how to execute the same GraphQL query using a curl command. It includes necessary headers and the raw JSON data for the query. Remember to substitute {{api_host}} and "auction-code" with actual values. ```sh curl --location --request POST 'https://{{api_host}}/graphql' \ --header 'x-amz-user-agent: aws-amplify/2.0.1' \ --header 'content-type: [{"key":"content-type","value":"application/json","enabled":true}]' \ --header 'accept-language: en-US,en;q=0.9' \ --header 'Authorization: {{AccessToken or IdToken}}' \ --data-raw '{ "query": "query test { auction(id: \"auction-code\") { assets { purchased(pageRequest: { pageSize: 10, pageNumber: 1 }) { items { vin year make model exteriorColor } } } } }'" ``` -------------------------------- ### Sample GraphQL JSON Response Source: https://github.com/auctionedge/developer-access/blob/main/README.md This is an example of a JSON response structure from a successful GraphQL query. The 'data' field contains the results, mirroring the requested schema and fields. ```json { "data": { "auction": { "assets": { "purchased": { "items": [ { "vin": "1GKS2HKJ3JR259932", "year": "2018", "make": "GMC", "model": "Yukon XL", "exteriorColor": "White" } ] } } } } } ``` -------------------------------- ### HTTP Request to Initiate Authentication Source: https://github.com/auctionedge/developer-access/blob/main/README.md This snippet shows the raw HTTP request structure for initiating authentication with AWS Cognito. Ensure all placeholder values like {{username}}, {{password}}, and {{client_id}} are replaced with your actual credentials. ```http POST / HTTP/1.1 Host: cognito-idp.us-west-2.amazonaws.com X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth Content-Type: application/x-amz-json-1.1 { "AuthParameters": { "USERNAME": "{{username}}", "PASSWORD": "{{password}}" }, "AuthFlow": "USER_PASSWORD_AUTH", "ClientId": "{{client_id}}" } ``` -------------------------------- ### HTTP POST Request for GraphQL Query Source: https://github.com/auctionedge/developer-access/blob/main/README.md This snippet shows a basic HTTP POST request to the /graphql endpoint. Ensure you replace placeholder values like {{api_host}} and "auction-code" with valid information. The 'content-type' header is set to application/json. ```HTTP POST /graphql HTTP/1.1 Host: {{api_host}} x-amz-user-agent: aws-amplify/2.0.1 content-type: [{"key":"content-type","value":"application/json","enabled":true}] accept-language: en-US,en;q=0.9 Authorization: {{AccessToken or IdToken}} { "query": "query test { auction(id: \"auction-code\") { assets { purchased(pageRequest: { pageSize: 10, pageNumber: 1 }) { items { vin year make model exteriorColor } } } } }"} ``` -------------------------------- ### cURL Request for Authentication Source: https://github.com/auctionedge/developer-access/blob/main/README.md This cURL command demonstrates how to make the authentication request to AWS Cognito. Replace the placeholder variables with your specific authentication details. ```sh curl --location --request POST 'https://cognito-idp.us-west-2.amazonaws.com' \ --header 'X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth' \ --header 'Content-Type: application/x-amz-json-1.1' \ --data-raw '{ "AuthParameters": { "USERNAME": "{{username}}", "PASSWORD": "{{password}}" }, "AuthFlow": "USER_PASSWORD_AUTH", "ClientId": "{{client_id}}" \ }' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.