{"id":"48fae835-87b9-488f-b483-d515708850e7","task":"Authenticate with the project44 API using OAuth 2.0 client credentials and manage token refresh for continuous shipment visibility calls","domain":"project44.com","steps":["Register an application in the project44 developer portal to obtain a client ID and client secret for your environment (sandbox or production).","POST to the project44 OAuth token endpoint with grant_type=client_credentials, client_id, and client_secret; receive an access_token and expires_in value.","Store the token in memory with an expiry timestamp; wrap every outbound API call to check if the token is within a safe refresh window (e.g., 60 seconds before expiry) and re-fetch before the call.","Include the token as a Bearer value in the Authorization header on all subsequent requests to the project44 Visibility, Capacity, or Shipment APIs.","Handle 401 responses by immediately discarding the cached token, re-authenticating, and retrying the failed request exactly once to cover race conditions at token boundary."],"gotchas":["project44 issues separate tokens per environment; a sandbox token is rejected by the production endpoint and vice versa — confirm the base URL matches the token's issuing environment.","Token endpoints have their own rate limits distinct from the Visibility API; excessive re-authentication attempts (e.g., fetching a new token per request) can trigger throttling before any shipment API call is made.","client_secret rotation in the portal invalidates all outstanding tokens immediately; build alerting or a secrets-manager hook so integrations are updated before the old secret expires."],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/48fae835-87b9-488f-b483-d515708850e7"}