Create Campaign using API: 1007errorUnauthorized request

Create Campaign using API: 1007errorUnauthorized request

Hi there, 

I'm trying to create a campaign using the APIs and following step by step this documentation https://www.zoho.com/campaigns/help/developers/create-campaign.html, but I have an
1007 error Unauthorized request.

I created (I'm using PHP) the code to find access token and the refresh token as documentation said with POST request; after that I used the getmailinglists GET request to find the JSON for the  'list_details' parameter ( mandatory to create the campaign).

Now I'd like to create the campaign. here my code:
  1. // CREATE CAMPAIGN:
  2. $access_token = 1000.xxxxxxxxxxxxxxxxxxxxx ;
  3. $headers = array("Content-Type: application/x-www-form-urlencoded",
                        "Authorization: Zoho-oauthtoken $access_token");


  4. $list_details = '{"code":"0","uri":"/api/getmailinglists","version":"1",
    "list_of_details":[{"date":"20 Feb 2018, 05:30 PM","deletable":"true","segments":{},"listdesc":"","list_created_time":"00:30 PM","noofunsubcnt":"0","lockstatus":"unlocked",
    "listkey":"xxxxxxxxxxx","sentcnt":"1","owner":"Name Surname","list_campaigns_count":"1","created_time":"1519173003000",
    "noofcontacts":"4","editable":"true","listname":"Test","listdgs":"xxxxxxxxxx",
    "noofbouncecnt":"0","issmart":"false","list_created_date":"20 Feb 2018","listnotifications":"[]","listunino":"xxxxxxxxxx","zuid":"xxxxxxxx","servicetype":"1","sno":"2",
    "is_public":"false","otherslist":"false","zx":"12698717a"}],"requestdetails":{"fromindex":1,"range":20,"total_list_count":1,"sort":"Recently Created"},"status":"success"}';
       
  5. $args = array(
            'campaignname' => 'New newsletter',
            'from_email' => 'name@mail.it',
            'subject' => 'test html',
            'content_url' => 'https://www.mysite.it/zoho/campaign.html',
            'list_details' => $list_details
        );

        $curl_campaign = curl_init();
        curl_setopt($curl_campaign, CURLOPT_URL,"https://campaigns.zoho.eu/api/v1.1/createCampaign");
        curl_setopt($curl_campaign, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($curl_campaign, CURLOPT_HEADER, $headers);
        curl_setopt($curl_campaign, CURLOPT_POST, true);
        curl_setopt($curl_campaign, CURLOPT_POSTFIELDS,$args);
        $result_campaign = curl_exec($curl_campaign);
        curl_close($curl_campaign);

        echo $result_campaign;

    }
Why I still having the 1007 error?

I hope for a quick response,
thanks
Alessandra

    • Sticky Posts

    • Tip of the week 03 - Sending emails in batches

      Today's marketers not only want their email marketing to be efficient, but also smart. For an email campaign, you may think you have all the essential elements for lead conversion—a big mailing list, an attractive template design, and the most-engaging message content, but after hitting the ‘send’ button, you may not get the expected conversions. Wondering why? Here’s one of the major reasons. Many marketers miss out on sending the email campaign the right way. Did you know that you should not be
    • Tip of the week 04 - Know about your recipients' 'prime open time.'

      In today's market, the importance of customer behavior is astounding, with a vast amount of research and resources going into finding how customers make decisions. The process of persuading your customers to open your email and click on your call-to-action becomes easy when you understand the psychology behind their behavioral traits. Time to turn into a psychologist! Let's get to the basics—you want your emails to resonate well with your recipients. So, what's the primary thing involved here? It's
    • Zoho Campaigns Expert Diaries on SoundCloud, Spotify, Apple Podcasts, and YouTube

      Hi email champs,  As email marketers, we find great lessons in each other's works—be it the subject lines that worked good, the design that was received well, or the CTA that had the maximum clicks. Email marketing encompasses a wide variety of topics spanning everything from creation and design to development and deliverability.  Here's when we from the Zoho Campaigns team found the need to build an email marketing community comprising of seasoned marketers and email geeks who can help each other
    • Email Deliverability Tip #3: Seal the deal with the preheader

      In the last post, we learned about the subject line. Today we'll be learning about the preheader. A preheader is the short text that follows the subject line in an email. The preheader is designed to hint at what your email message is all about. A good preheader should act as a second subject line and convince your contacts to open the email. Now, let's learn the best way to craft a preheader. Your subject line and preheader should work together and accurately convey the gist of your email. Keep
    • Tip of the week 15 - Add subscription-preferences option. Drive more engagement.

      If crafting content for emails, getting creatives done, and running email campaigns is your love, then unsubscribes are the heartbreakers.  You can save your emails from being unsubscribed/trashed by adding a proper subscription-preferences option in your emails (works best at the time of signup). Giving subscribers the option to choose what they want to receive from you and decide how often (frequency of the emails) your emails should hit their inboxes will increase the reach of your campaigns manifolds. 
    • Recent Topics

    • Adding Chargebee as a Data Connector

      Is it possible to get Chargebee added as a Zoho Analytics data connector?
    • Delete commerce website

      I need to delete a commerce website, but the only option is to click on settings, REQUEST DELETE, choose an urgency notice, add a message....AND THEN nothing, no way to send the request. Why is nothing simple!?!?!  I just want to delete the store.  The
    • Adding external users to Zoho Social under Zoho ONE licence - how to best achieve this

      My client has a small business, and we are looking to implementing Zoho ONE with a single flexible user licence as that is all they really need and offers the best pricing for the range of modules we eventually wish to set them up with, one of which will
    • Has anyone built a custom AI support agent inside Zoho (SalesIQ/Zobot)?

      Hi all, I’ve been experimenting with building my own AI support assistant and wanted to see if anyone here has tackled something similar within Zoho. Right now, I’ve set up a Retrieval-Augmented Generation (RAG) pipeline outside of Zoho using FAISS. It
    • This mobile number has been marked spam. Please contact support.

      Problem Description: One of our sales agents in our organization is unable to sign in to Zoho Mail. When attempting to log in, the following message appears: This mobile number has been marked as spam. Please contact support at as@zohocorp.com @zohocorp
    • Zoho Books - Hide Convert to Sales Order if it can't be used.

      Hi Books team, I noticed that it is not possible to convert a Quote to a Sales Order when a Quote is not yet marked as accepted. My idea is to not show the Convert to Sales Order button when it is not possible to use it, or show it in a grey inactive
    • What’s New in Zoho Inventory | April 2025

      Hello users, April has been a big month in Zoho Inventory! We’ve rolled out powerful new features to help you streamline production, optimise stock management, and tailor your workflows. While several updates bring helpful enhancements, three major additions
    • Zoho Books - Quotes to Sales Order Automation

      Hi Books team, In the Quote settings there is an option to convert a Quote to an Invoice upon acceptance, but there is not feature to convert a Quote to a Sales Order (see screenshot below) For users selling products through Zoho Inventory, the workflow
    • When Zoho Tables Beta will be open to EU data center

      Hello all, We in EU are looking at you all using and testing and are getting jealous :) When we will be able to get into the beta also? We don't mind testing and playing with beta software. Thank you!
    • Pass current date to a field using Zoho Flow

      I am trying to generate an invoice automatically once somebody submits a record in Zoho CRM. I get an error in the invoice date. I have entered {{zoho.currentdate}} in the Date field. When I test the flow, I get "Zoho Books says "Invalid value passed
    • API: Mark Sales Order as Open + Custom Status

      Hi, it's possible to create Custom Status (sub-status actually) states for the Sales Order. So you have Open, Void. Then under Open you can have Open, and create one called Order Paid, Order Shipped, etc etc...which is grouped under Open. I can use the
    • Zoho Quartz Screen Recording

      Hello, can we get access to Quartz, please, as a standalone solution? It would be great for creating training videos for current and future staff on how to use Zoho software according to our company requirements. Thank you
    • Tip 26: How to hide the "Submit" button from a form

      Hi everyone, Hope you're staying safe and working from home. We are, too. By now, we at Zoho are all very much accustomed to the new normal—working remotely. Today, we're back with yet another simple but interesting tip--how to hide the Submit button from your forms. In certain scenarios, you may want to hide the submit button from a form until all the fields are filled in.  Use case In this tip, we'll show you how to hide the Submit button while the user is entering data into the form, and then
    • filter broke my data

      I uploaded a file recently from Sheets and it has top 2 rows frozen, with table headers in second row and each one is filterable. somehow my first 2 columns became unfiltered and no matter what I do I cannot reapply the filter?? also didn't realize they
    • How do I move Notes around within a Group?

      It says here: " You can now sort notes by title (alphabetically), or by date modified and date created. You can even organize your notes by dragging and dropping them into a particular order. To sort your notes, simply go to Settings and tap “Sort By.” Please note: all sort settings will be saved and synced across devices, except for custom sorting. Custom sorting will be device specific."However, I am unable to 'custom sort' in either Notebook for Mac or on the Web. In addition, I can't find the
    • Generate a link for Zoho Sign we can copy and use in a separate email

      Please consider adding functionality that would all a user to copy a reminder link so that we can include it in a personalized email instead of sending a Zoho reminder. Or, allow us to customize the reminder email. Use Case: We have clients we need to
    • Zoho Sign: need to leave document pending for up to a year, or maybe there's a better way?

      I have zoho one, maybe there's a better way to do this with another service than sending a zoho sign template from zoho crm. At the end of the day this requirement is due to regulations, no matter how dumb it may seem. I'm just looking for a way of getting
    • Separate Items & Services

      Hi, please separate items and services into different categories. Thank you
    • What's New in Zoho Inventory | Q2 2025

      Hello Customers, The second quarter have been exciting months for Zoho Inventory! We’ve introduced impactful new features and enhancements to help you manage inventory operations with even greater precision and control. While we have many more exciting
    • Mastering Zia Match Scores | Let's Talk Recruit

      Feeling overwhelmed by hundreds of resumes for every job? You’re not alone! Welcome back to Let’s Talk Recruit, where we break down Zoho Recruit’s features and hiring best practices into simple, actionable insights for recruiters. Imagine having an assistant
    • We are unable to process your request now. Please try again after sometime or contact support@zohoaccounts.com

      I cannot sign up and return the error of we are unable to process your request now. Please try again after sometime or contact support@zohoaccounts.com
    • Multi-currency - What's cooking ?

      Hi,       We have been doing this feature for sometime and we would like to give you some glimpses of it.  Working with Multi Currency :        Multicurrency support gives you the ability to handle business transactions in multiple currencies. You can define a base currency for your organization and add more currencies with exchange rates based on the base currency.  Setup :        From the setup page, you can manage all the currencies supported by your organization.       Currencies page        
    • Integrating Chatbot with Zoho Creator Application

      Is it possible to integrate a chatbot with a Zoho Creator application?
    • How to reduce programmatically the image uploaded by user?

      I need a function that will automatically reduce the pixel dimension to 800 x 600 pixels / 180 resolution or (approx. 1.37MB) of image uploaded by user from digital camera, for example, 2271 x 1704 pixels /180 resolution or approx. 11.1MB. After the user selected the image, the function will able to detect if pixels is above 800x600, process the photo (crop/ reduce) and resume upload. Need help...  
    • Dark mode for Zoho Creator / Zoho CRM Code editor

      Hi Team, Is there any plans for Dark mode in Zoho creator / Zoho Crm code editor and development pages in pipeline?
    • Is there a way to make a button scroll down?

      Looking to have a button on a landing page scroll down to another section on the page. Any recomendations outside of coding?
    • Collective-booking event not added to all staff calendars

      We assign two staff to certain events. When the client books this event, it adds it to one staff calendar (the 'organiser') but not the other. How can I ensure all staff assigned to a collective booking get the event in their calendar? (A side note: it
    • ZOHO Android Client

      Hi, I installed the Android app, but it had an issue, so I reinstalled it. I was able to add multiple accounts, but now when I add the next account, it just duplicates the one I already have and will not even allow me to enter the info for another account.
    • I'd like to suggest a feature enhancement for SalesIQ that would greatly improve the user experience across different channels.

      Hello Zoho Team, Current Limitation: When I enable the pre-chat form under Brands > Flow Controls to collect the visitor’s name and email, it gets applied globally across all channels, including WhatsApp, Messenger, and Instagram. This doesn't quite align
    • Enhance Barcode/QR Code scanner with bulk scanning or continuously scanning

      Dear Zoho Creator, As we all know, after each scan, the scanning frame closes. Imagine having 100 items; we would need to tap 100 times and wait roughly 1 second each time for the scanning frame to reopen on mobile web. It's not just about wasting time;
    • Non-depreciating fixed asset

      Hi! There are non-depreciable fixed assets (e.g. land). It would be very useful to be able to create a new type of fixed asset (within the fixed assets module) with a ‘No depreciation’ depreciation method. There is always the option of recording land
    • Managing Rental Sales in Zoho Inventory

      I am aware that Zoho Inventory is not yet set up to handle rental sales and invoicing. Is anyone using it for rentals anyway? I'd like to hear about how others have found work arounds to manage inventory of rental equipment, rental payments, etc. Th
    • Megamenu

      Finally! Megamenu's are now available in Zoho-Sites, after waiting for it and requesting it for years! BUT ... why am I asked to upgrade in order to use a megamenu? First: Zoho promised to always provide premium versions and options for all included Zoho-applications
    • Cannot access KB within Help Center

      Im working with my boss to customize our knowledge base, but for some reason I can see the KB tab, and see the KB categories, but I cannot access the articles within the KB. We have been troubleshooting for weeks, and we have all permissions set up, customers
    • Zoho Flow to Creator 3001 Respoonse

      I have updated my Flows with the new V2 connection to Zoho Creator, but now some Flows do not work. They take in data from a Webhook and are supposed to create a record in Creator, however creator returns a 3001 message along with a failure, but I cannot
    • File Upload to Work Drive While Adding Records in Zoho Creator Application

      Hi I am trying to set a file attachment field in zoho creator form, to enable the user to upload a scanned document from their local pc. The file should be uploaded to zoho workdrive and not to the default zoho creator storage. The file link should be
    • Why not possible to generate?

      Using this https://desk.zoho.com/DeskAPIDocument#TicketCount#TicketCount_Getticketcountbyfield on my ZML script url :"https://desk.zoho.com/api/v1/ticketsCountByFieldValues?departmentId=XXXXXXXXXXX&accountId!=XXXXXXXXX&customField1=cf_country_1:XXXXXX&field=overDue"
    • email

      Hi My crm email is not working, can you check, I have zoho one account.
    • Need option to see Mass Emails & Cadences in Gmail Outbox OR a dedicated Zoho Outbox

      Hi everyone, Right now, when we send 1:1 emails from gmail (with gmail API connected to Zoho CRM), those emails appear both in gmail's sent folder and in Zoho CRM. That works well. But when we send Mass Emails or Cadence emails form Zoho CRM, they are
    • I can't found API for Sales Receipts

      Hello May you please help me to find an API document for Sales Receipts to get data and retrive a custom fields like Invoice and credit notes Regards
    • Next Page