App Store Connect API request Sales Report - app-store-connect

App Store connect api requested sales report with curl.
Below is the request address according to the apple guide.
curl -v -H 'Authorization: Bearer [token]'
"https://api.appstoreconnect.apple.com/v1/salesReports?filter\
[frequency\]=DAILY&filter\[reportDate\]=2019-02-01&filter\
[reportSubType\]=SUMMARY&filter\[reportType\]=SALES&filter\
[vendorNumber\]=86890785&filter\[version\]=1_0"
According to the guide, the 'users' information is normally obtained, but the sales report is garbled and the response comes.
?p?\?{~7[?.?????j???????p?????E?????q6?}?|?/???{?]???z??O?fϫ??s???<?W?????w;?ݽ??g?????t5?U????O?7?-???ۿF?W?!??\?/?l?={//??߸??\,?3=??E??/?꯯??{????v9Y????r????/????}=p?/?z{yY,W?????t??b??:?G0??M_???Ζ??F???????q?~??|??~0????ŧ?ї????i?ǭ??Ƿ??????n??0?G??????}}gN?I<
?"?ˬ???3?????y?x{???r5?߿?;s?=ڻ?R&F'????;???7?X?I?LΏ?C?1&õ?y??????????a'E?$qǯX<϶?}"wo???ų}a???Џ!?Frrv?>?1?yT?e????s?x?ReY
"?D]??ru??-?&IY?EţtR??o?O???}?meË???? ?1?0??4???K?x?*T+nu?}??S???ד?P ........skip
I think there are a lot of data to fetch this problem. Is there a way to solve it?
Thank you in advance.
Apple guide : https://developer.apple.com/documentation/appstoreconnectapi/download_sales_and_trends_reports

The response is compressed in .gz format. Try to perform get with Postman and download the result in order to check it out.

Related

LinkedIn API App - "Resource search does not exist"/"Empty oauth2 access token"

I am working on a simple searching app using LinkedIn's API.
I have set my base-url for the LinkedIn Sales Navigator to:
base_url = "https://api.linkedin.com/v2/search"
I have also obviously added my client_id, client_secret, and access_token in the headers.
However, upon running the program, I am getting the error:
{"serviceErrorCode":0,"message":"Resource search does not exist","status":404}
This makes me think that there is a problem with the base-url. But then, upon visiting the link my program is trying to visit, I am met with a JSON that says:
serviceErrorCode 65604 message "Empty oauth2 access token" status 401
However, as far as I am concerned, I have gone through the OAuth2 flow correctly and in full.
But I'm not sure what it actually is.
Any ideas?
Thanks in advance.
this search point is depreciated. this is allowed to the selected developer only. First, make sure that you have the permissions for that. For reference, you can visit this link
The other thing, if you have permission, then you need to pass the bearer token in the header for authorization.
curl --location --request GET 'https://api.linkedin.com/v2/search' \
--header 'Authorization: Bearer {INSERT_TOKEN}' \
The complete information can be found here.

How to get fullAccountNumber in Yodlee

Calling the /accounts/{accountId} endpoint with the include fullAccountNumber returns an error Y821 - fullAccountNumber not supported.
I'm doing:
curl -i -H "Api-version: 1.1" -H "Authorization: Bearer {token}" -X
GET https://production.api.yodlee.com/ysl/accounts/{accountId}
?container=bank&include=fullAccountNumber,holder,profile
Note: the line breaks are just for readability
How do you get fullAccountNumber?
It looks like you are calling the API correctly. This feature needs to be enabled for your account, after approval from the Yodlee Security Office. You can make an application through your account manager.
The error message should be updated to something more helpful, like “fullAccountNumber feature is not enabled for account. Please contact Yodlee support.”
Circling back to this because it's been more than a year and want to have a solution:
This was not possible with Yodlee and we went with a different solution.

How to make Twitter API call through curl in unix

I would like to pull the data from Twitter REST API. I have created the consumer key, secret and Access token, secret. I have tried with "Test OAuth", it generates a CURL command but if I change any one parameter then it is giving the below error.
Message: {"errors":[{"code":32,"message":"Could not authenticate you."}]}
Now I would like to call the twitter API using CURL in shell script for different screenNames.
I want a sample command some thing like mentioned below
curl --get 'https://api.twitter.com/1.1/statuses/user_timeline.json' --data 'count=2&screen_name=aswin' APIKEY:"xxxxxx",Acesstoken:"yyyyyyyy"
Thanks in advance.
Regards,
Aswin
I found the answer.
curl --get 'https://api.twitter.com/1.1/statuses/user_timeline.json' \
--data 'count=2&screen_name=twitterapi' \
--header 'Authorization: OAuth oauth_consumer_key="AAAAAAAAAAAAAAAAAAAA", oauth_nonce="BBBBBBBBBBBBBBBBBBBBBBB", oauth_signature="CCCCCCCCCCCCCCCCCCCCCCCCCCC", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1471672391", oauth_token="DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", oauth_version="1.0"'
Since your specific query doesn't require a user context you can use Application only authentication to make this request. The bearer token won't change per request so it should allow you to keep using curl.
https://dev.twitter.com/oauth/application-only
n.b. it won't work for all endpoints, but should for the case you listed.
Because most twitter requests require calculating the oauth signature, you should either write a client yourself or reuse an existing command line client.
https://github.com/twitter/twurl
https://github.com/sferik/t
https://github.com/yschimke/oksocial/wiki (Mac focused/cross service)
As you saw any change to the request will generally invalidate the query, and even time is one of the inputs.

Confluence REST API Authorization Failure

I am trying to use the Confluence REST API to create a page. I am using the curl example off of the documentation found HERE. Every time I try to run a terminal command using this curl I get a response that says 'HTTP Status 401 - Basic Authentication Failure - Reason : AUTHENTICATION_DENIED'. I see that someone else had a similar issue regarding their C# code, but there was never a resolution given. Hopefully someone with experience will be able to tell me what I am doing wrong. My curl is listed below with the sensitive parts replaced in <> format.
curl -u <USER>:<PASSWORD> -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","space":{"key":"<PAGEKEY>"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' https://<SERVER>/wiki/confluence/rest/api/content/ | python -mjson.tool
I was finally able to resolve this. Through a combination of the answer here How to create new page in Confluence using their REST API? and using a login that had the appropriate permissions.

API Post Data to Middleware

Anyone know how I can test posting data to this url? I was given the link by the IT supervisor and trying to have the data posted to the following link by submitting the following form. He said it would accept anything I send it
Could could do this via curl:
curl -X POST -d "data=anything_i_send_it" http://powersource.braindongle.com/lead-manager/lead/new/omgpost/sessions/
Or using another HTTP tool like Hurl.it
Or using a Chrome extension like Postman or REST Console.
Advanced Rest Client is an easy way to do it. It's a free chrome extension that can form http requests with data.