geertmeersman / mobile_vikings

Home Assistant component for Mobile Vikings BE services
MIT License
8 stars 1 forks source link

Support for mobilevikings.pl accounts #99

Closed asgraf closed 2 months ago

asgraf commented 8 months ago

Currently add-on does not support mobilevikings.pl accounts

geertmeersman commented 8 months ago

Hi Michal,

Possible to share some xhr call examples? To know if the calls are identical to the Belgian ones?

asgraf commented 8 months ago

Example request url: https://mobilevikings.pl/api/v12/me/

Example response (anonymised):

{
  "id": 123,
  "first_name": "John",
  "last_name": "Doe",
  "username": "user_hash_61ce5813383fd4be25f8",
  "email": "email@example.com",
  "avatar": "https://mobile-vikings-pl-prod-media.s3.amazonaws.com/avatars/censored.jpg",
  "is_active": true,
  "is_adult": true,
  "is_company": false,
  "mgm_master": null,
  "has_active_subscription": true,
  "identity": {
    "first_name": "John",
    "last_name": "Doe",
    "masked_pesel": "123********",
    "identification_type": "IDENTITYCARD",
    "masked_identification_number": "ABC****",
    "company_name": "",
    "masked_vat": null
  },
  "has_blik_alias": false
}

Example request url2: https://mobilevikings.pl/api/v12/me/subscriptions/

Example response2 (anonymised):

{
  "objects": [
    {
      "uuid": "cb0eccb7-5966-4f03-9c4a-cb6f97ed5f9a",
      "msisdn": {
        "slug": "48111222333",
        "name": "111 222 333",
        "description": ""
      },
      "state": "active",
      "tariff": "legacy_voice_tariff",
      "is_primary": true,
      "current_price_plan": {
        "slug": "product_25",
        "price": "25.00",
        "valid_for": "360",
        "valid_for_suffix": "dni",
        "name": "Standard 25",
        "expiration_date": "2025-01-01T22:59:59Z",
        "is_expired": false,
        "base_price": "25.00"
      },
      "autotopup": {
        "state": "inactive",
        "disabled": false,
        "price_plan": "product_25",
        "next_execution_date": "2022-01-01T00:00:00Z",
        "price_plan_price": "25.00",
        "subscription_offer_state": null
      },
      "autorefill": null,
      "mgm": null,
      "mgm_reward": {
        "state": "no_mgm",
        "discount": "0.00",
        "discount_percent": "0.00"
      },
      "mobile_dashboard": null,
      "custom_topup": {
        "state": "active",
        "disabled": false
      },
      "buy_package": {
        "state": "active",
        "disabled": false
      },
      "offer_topup": {
        "state": "active",
        "disabled": false
      },
      "queued_topups": [],
      "active_campaigns": [],
      "gb_sharing": null,
      "offer_migration": {
        "state": "inactive",
        "disabled": false
      }
    }
  ],
  "purchase_new_number": {
    "label": "Chcesz zamówić lub przenieść kolejny numer?",
    "action": {
      "slug": "order_sim_card",
      "action_type": "authorized_url",
      "label": "Zamów kartę",
      "link": "https://mobilevikings.pl/pl/lab/auth-webview/?next_url=/pl/rejestracja/"
    }
  }
}
geertmeersman commented 8 months ago

It seems they run it on a completely different API platform in PL :-( I would mean some rework of the API calls, so depending on the country, but it should be feasible

asgraf commented 7 months ago

Additionally in Poland you use email instead of username to log in.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

geertmeersman commented 5 months ago

hi @asgraf , I'll soon have some time to refactor the client part of mobilevikings, so I'll ask you to do some tests. Do you have the possibility to do some python tests?

asgraf commented 5 months ago

Work as a programmer but I do not know Python. I can test it for you if you instruct me how :)

geertmeersman commented 5 months ago

@asgraf, will do, currently on holidays, but should be able to find some time on my return!

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

geertmeersman commented 4 months ago

No need for stale, just need some time 🤪

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.