Created
June 27, 2020 16:30
-
-
Save daronyondem/1e791e1e072836881ad39d6e0a44163d to your computer and use it in GitHub Desktop.
Getir'den PDF faturaları indirip toplu alan kod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$accessToken = "{access_token}" | |
$pageNumber = 0 | |
$userAgent = "getir/2.6.1 (iPhone; iOS 13.5.1; Scale/3.00)" | |
$Response = Invoke-WebRequest -Uri "https://getirx-client-api-gateway.getirapi.com/order-history?pageNumber=$($pageNumber)" -Headers @{"Accept" = "application/json"; "Content-Type" = "application/json"; "User-Agent" = $userAgent; | |
"Accept-Language" = "en-TR;q=1, tr-TR;q=0.9";"Accept-Version" = "2.0.0";"token" = $accessToken;} | ConvertFrom-Json | |
$orders = $Response.data.orders | select id, createdAt | |
Foreach ($order in $orders) | |
{ | |
$order.createdAt = $order.createdAt -replace ":", "-" | |
$Response = Invoke-WebRequest -Uri "https://getirx-client-api-gateway.getirapi.com/invoice-url?orderId=$($order.id)" -Headers @{"Accept" = "application/json"; "Content-Type" = "application/json"; "User-Agent" = $userAgent; | |
"Accept-Language" = "en-TR;q=1, tr-TR;q=0.9";"Accept-Version" = "2.0.0";"token" = $accessToken;} | ConvertFrom-Json | |
Invoke-WebRequest -Uri $Response.data.invoiceUrl -OutFile "C:\temp\$($order.createdAt).pdf" | |
} |
Yanlis hatirlamiyorsam o zamanlar iphone uygulamasini PC deki snifferdan gecirmistim :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
access token'i nerden alacağım?