GithubHelp home page GithubHelp logo

bdadvertisingservicetomtarpey's Introduction

Unit 5 Project: ATA Advertising Service

Preliminaries: The More Things Change

Ambiguity, Complexity, and Scope

Ambiguity will be increasing from previous projects. Tasks instructions will contain fewer details, as we expect you to reference documentation and deep dive into the code yourself to understand how things work. Even if there isn't a specific task for it, you're of course welcome to create any diagrams or other notes as a reference for yourself or others!

There will be some increasing complexity as we work with ExecutorServices for the first time.

You'll have your fellow participants in the same situation as you, so remember to collaborate: rely on each other for assistance, and share your own knowledge.

Unit 5 Project Progress and Tracking

Doneness checklist

You're done with the project when:

  • You can access your service through curl
  • Your CRs have passed review and all steps in your pipeline (including CR verification and TCTs) succeed
  • You've submitted the Project Reflection response in Canvas
  • You've completed the Participant End-of-Unit Survey (a short survey to help us improve the project and the project process for next time! Optional, but highly encouraged)

The Problem: ATA Advertising

ATA's AdvertisingService serves advertisements for ATA. These advertisements show up on the retail website and use targeting to present different ATA advertisements to each individual. The targeting tries to take advantage of what Amazon knows about you to show you the particular ad that is most likely to appeal to you.

An overview of the service is covered in the design document. We encourage you to read that now before continuing below.

Accessing operations via curl

Coral requires some HTTP headers that aren't supplied by default. The Coral Explorer automatically adds those headers to its requests, but the framework we use in this project doesn't allow us to use the Explorer. When you use curl, you'll need to supply a Content-Encoding and Content-Type that Coral recognizes, along with an Amz-Target header indicating which API you want to call.

You can reference the templates and examples below when you're testing your code.

GenerateAdvertisement

template

curl \
-X GET \
-sS 'http://localhost:1186/advertisement/<marketplaceId>?customerId=<customerId>' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.GenerateAdvertisement'

example

curl \
-X GET \
-sS 'http://localhost:1186/advertisement/1?customerId=10' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.GenerateAdvertisement'

CreateContent

template

curl \
-X POST \
-sS 'http://localhost:1186/content' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.CreateContent' \
-d '{"__type":"com.amazon.ata.advertising.service#CreateContentRequest","content":"<content>", "marketplaceId":"<marketplaceId>"}'

example

curl \
-X POST \
-sS 'http://localhost:1186/content' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.CreateContent' \
-d '{"__type":"com.amazon.ata.advertising.service#CreateContentRequest","content":"Hello World", "marketplaceId":"1"}'

AddTargetingGroup

template

curl \
-X POST \
-sS 'http://localhost:1186/targetingGroups' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.AddTargetingGroup' \
-d '{"__type":"com.amazon.ata.advertising.service#AddTargetingGroupRequest","contentId":"<contentId>", "targetingPredicates":"<targetingPredicates>"}'

example

curl \
-X POST \
-sS 'http://localhost:1186/targetingGroups' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.AddTargetingGroup' \
-d '{"__type":"com.amazon.ata.advertising.service#AddTargetingGroupRequest","contentId":"0b63284a-9c16-11e8-98d0-529269fb1459","targetingPredicates":[{"targetingPredicateType":"AGE","negate":false,"attributes":{"AgeRange":"AGE_26_TO_30"}}]}'

UpdateClickThroughRate

template

curl \
-X PUT \
-sS 'http://localhost:1186/targetingGroups/<targetingGroupId>' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.UpdateClickThroughRate' \
-d '{"__type":"com.amazon.ata.advertising.service#UpdateClickThroughRateRequest","targetingGroupdId":"<targetingGroupId>", "clickThroughRate":"<clickThroughRate>}'

example

curl \
-X PUT \
-sS 'http://localhost:1186/targetingGroups/ba9568e2-b239-48bc-a167-8a2797f7935e' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.UpdateClickThroughRate' \
-d '{"__type":"com.amazon.ata.advertising.service#UpdateClickThroughRateRequest","targetingGroupId":"ba9568e2-b239-48bc-a167-8a2797f7935e", "clickThroughRate":"0.54"}'

UpdateContent

template

curl \
-X PUT \
-sS 'http://localhost:1186/content/<contentId>' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.UpdateContent' \
-d '{"__type": "com.amazon.ata.advertising.service#UpdateContentRequest", "contentId": "<contentId>", "advertisingContent":<advertising content>}'

example

curl \
-X PUT \
-sS 'http://localhost:1186/content/df4568e2-b349-14cd-y35f-be34f7s3457ge' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1; charset=UTF-8' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.UpdateContent' \
-d '{"__type":"com.amazon.ata.advertising.service#UpdateContentRequest","contentId":"df4568e2-b349-14cd-y35f-be34f7s3457ge","advertisingContent":{"id":"df4568e2-b349-14cd-y35f-be34f7s3457ge","marketplaceId":"1","content":"join ata!"}}'

DeleteContent

template

curl \
-X DELETE \
-sS 'http://localhost:1186/content/<contentId>' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.DeleteContent' \
-d '{"contentId":"<contentId>"}'

example

curl \
-X DELETE \
-sS 'http://localhost:1186/content/ba9568e2-b239-48bc-a167-8a2797f7935e' \
-H 'Content-Encoding: amz-1.0' \
-H 'Content-Type: application/x-amz-json-1.1' \
-H 'X-Amz-Target: com.amazon.ata.advertising.service.ATACurriculumAdvertisingService.DeleteContent' \
-d '{"contentId":"ba9568e2-b239-48bc-a167-8a2797f7935e"}'

Project Preparedness Tasks

Project Mastery Tasks

Project Reflection

Think over the entire project, from the introduction to the final mastery task completion. Answer three or more questions in the Canvas Project Reflection Quiz.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.