GET /imfpush/v1/apps HTTP/1.1
Host: mobilefoundation-3b-mf-server.mybluemix.net
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImp....
Content-Type: application/json
another type of invocation
curl -X GET -H "Authorization: Bearer eyJhbGciOiJSUzI1N...." "https://mobilefoundation-3b-mf-server.mybluemix.net/imfpush/v1/apps"
Error 502: Failed to make token request, reason: Unsuccessful request to Authorization Server, server responded with status code: 400 and body : {"errorCode":"invalid_client"}, check the Authorization URL: http://localhost:8080/mfp/api/az/v1/token
TL;DR: right now looks like there is a bug in the
/imfpush/v1/apps
endpoint where it does not filter the applications by the vendor (APNS, GCM, WNS), so you can only get a list of all applications instead...Note however that it all depends on your end goal. You can accomplish this by code or by using tools such as curl or Postman, Swagger etc... it all depends on what you want to achieve.
Here are 3 ways:
In the local development server - not available in Mobile Foundation service on Bluemix, you can use this URL to see the REST endpoints exposed in Swagger. You can then view push-enabled applications with this one: http://localhost:9080/doc/?url=/imfpush/v1/swagger.json#!/Applications/getAllApplications
user
client (id:user
, secret:user
)apps.read
andpush.application.*
scopesBe sure to click on the knob and add the
apps.read
andpush.applications.*
scopes.You will also be asked to authorize. Use the username and password for the
user
confidential client that you previously created.In my examples I will use Postman.
In MobileFirst Operations Console > Runtime Settings > Confidential clients:
user
client (id:user
, secret:user
)apps.read
andpush.application.*
scopesObtained an access token by making a POST request to
http://localhost:9080/mfp/api/az/v1/token
with:Authorization tab:
Body tab:
Obtained the list of applications by making a GET request to
http://localhost:9080/imfpush/v1/apps
with:Headers tab:
Bearer the-access-token-from-step-2
To filter the list by platform, the URL should change to the following, like the example in the API documentation:
http://localhost:9080/imfpush/v1/apps/?expand=true&filter=platform==A&offset=0&size=10
But since this does not work right now... use:http://localhost:9080/imfpush/v1/apps/
Of course, you need to change
localhost
to your server's host.To only obtain a list of all applications, it'd be faster to use the
mfpadmin
serviceapplications
endpoint. Using Postman:Created a new GET request to
http://localhost:9080/mfpadmin/management-apis/2.0/runtimes/mfp/applications
You can change the domain to yours.
In the Authorization tab, I have set the following:
In return I have received a list of registered applications.