Skip to content

Integration Example

briansemify edited this page Oct 21, 2025 · 2 revisions

Complete Integration Example (Sequence & Samples)

Sequence (recommended)

  1. Authenticate -> save token
  2. Run keyword budget estimation
  3. Create account with external_account_identifier
  4. Confirm returned account_id and campaign_id
  5. Attach product/service plan to account/campaign
  6. Add keywords to campaign
  7. Pull reports periodically
  8. Store any IAM credentials needed (securely)

Example: Authenticate (curl)

curl -X POST "https://uat.services.semify.com/api/v1/authentication/login" \
  -H "Content-Type: application/json" \
  -d '{"username":"api_user","password":"s3cr3t"}'

Example: Keyword Budget Estimation (curl)

curl -X POST "https://uat.services.semify.com/api/v1/keywords/budget/estimate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","seeds":["best seo"],"max_keywords":50}'

Example: Create account (curl)

curl -X POST "https://uat.services.semify.com/api/v2/accounts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"account_name":"Acme","phone":"555-1234","email":"a@acme.com","first_name":"John","last_name":"Smith","address_1":"123 Main St","city":"Anytown","state":"CA","postal":"90210","country":"US","website_url":"https://acme.com","external_account_identifier":"ACME-001"}'

Idempotency tip

  • If account creation might be called twice, first GET by external_account_identifier; only POST if not found.

Example error handling flow

  • On 401: re-authenticate and retry once.
  • On 429: backoff and retry up to N times with exponential delays.

Clone this wiki locally