I'm having trouble dealing with the Pull Task Queue REST API. Whenever I 
try it says "403 - you are not allowed to make this api call". I'm trying 
this in my computer, which is obviously out of the App and Compute Engine.


I have my Service account credential, my queue.xml in WEB-INF, and *now I'm 
wondering if the queue must be created first before start using it* ... is 
that necessary?


This is my code... Am I missing something?


JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();

List<String> scopes = new ArrayList<>();
scopes.add(TaskqueueScopes.TASKQUEUE);
scopes.add(TaskqueueScopes.TASKQUEUE_CONSUMER);

ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream is = classloader.getResourceAsStream("credential-12356.json");

GoogleCredential credential = 
GoogleCredential.fromStream(is).createScoped(scopes);

Taskqueue taskQueue = new Taskqueue.Builder(httpTransport, JSON_FACTORY, 
credential).setApplicationName(APPLICATION_NAME).build();

Taskqueue.Taskqueues.Get request = taskQueue.taskqueues().get(projectId, 
taskQueueName);
request.setGetStats(true);

//Get the queue!
TaskQueue queue = request.execute();



-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/1f41b4d3-374c-4bfc-8b0f-62e81b9fd692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to