Examples of ServiceApi


Examples of threescale.v3.api.ServiceApi

*/
public class Example {

    public void performAuthRep() {

        ServiceApi serviceApi = new ServiceApiDriver("my_provider_key");    // Create the API object

        ParameterMap params = new ParameterMap();                           // Create top level ParameterMap
        params.add("app_id", "appid");                                      // Set the Users App Id

        ParameterMap usage = new ParameterMap();                            // Create 1st Level PM for usage
        usage.add("hits", "3");                                             // Add number of hits metric
        params.add("usage", usage);                                         // Add 1st level to top level as "usage"

        try {
            final AuthorizeResponse response = serviceApi.authrep(params)// Perform the AuthRep and get the response

            if (response.success()) {                                       // Check if the AuthRep succeeded
                // Perform your calls there
            } else {
                // Handle failure here
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.